338 Commits

Author SHA1 Message Date
Sebastian Kupke f87b19140b Removed header from test images. 2022-05-05 12:31:58 +02:00
Sebastian Kupke 63ebbba42b Added second resolution test. 2022-05-05 12:29:27 +02:00
Sebastian Kupke 72c6abf031 Resolution tests. 2022-05-04 15:18:11 +02:00
Sebastian Kupke 9db52a004a Added scatter resolution test. 2022-05-04 13:27:31 +02:00
Sebastian Kupke 527fcb993c Removed videos from resolution test. 2022-05-04 09:53:55 +02:00
Sebastian Kupke c41209d0fc Added description to resolution. 2022-05-04 09:10:01 +02:00
Sebastian Kupke 7e9f0159e8 Added resolution test. 2022-05-03 16:50:19 +02:00
Uwe Oestermeier 074fb67906 Fixed problem with outdated loader and error handler.s 2022-05-02 16:41:22 +02:00
Sebastian Kupke 51b0ef4b1b Added VSCode workspace file. 2022-05-02 11:13:03 +02:00
Sebastian Kupke 1efe94ef97 Bump version number. 2022-04-29 10:30:05 +02:00
Sebastian Kupke 7f068c5d94 Fixed resize fullscreen bug. 2022-04-29 10:28:59 +02:00
Uwe Oestermeier eff934e8b5 Moved the addVelocity method after the transform to allow a modification of the delta within the transform method. To make this destructive side effect more explicit transform could return a modified value. But that could effect several projects. 2021-04-28 17:02:54 +02:00
Sebastian Kupke 266a770c8e Merge branch 'master' into obersalzberg
# Conflicts:
#	dist/iwmlib.js
#	dist/iwmlib.pixi.js
2021-03-15 17:02:08 +01:00
Uwe Oestermeier a5f94e0a5f Reverted changes from commit fa0256d782 and moved addVelocity from _move back to old locations. 2021-03-15 15:39:07 +01:00
Uwe Oestermeier fff7a4f685 Fixed import order. 2021-03-01 08:58:44 +01:00
Sebastian Kupke d0ae8893cc Version 1.1.1. 2021-02-24 16:15:20 +01:00
Sebastian Kupke 1b4eee6498 Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2021-02-24 16:14:26 +01:00
Sebastian Kupke ac779af339 Popup close buttons can take a URL. 2021-02-24 16:13:50 +01:00
Severin Opel 1316a727f3 Fixed offset error. 2021-02-01 13:54:40 +01:00
Severin Opel be950ec8c1 Tried fix scatter. 2021-02-01 13:40:57 +01:00
Severin Opel ca5a39d661 Changed wrapper and events to allow other EventListeners. 2021-01-26 08:01:51 +01:00
Severin Opel fa0256d782 Moved addVelocity to _move. 2021-01-05 16:25:55 +01:00
Severin Opel 114c217ffa Improved logging and adjusted card's click handler
+ Logging now also works when ipcRenderer is appended to the window element.
+ Card's callback replacement method was changed from click to pointerdown.
2020-09-15 11:36:59 +02:00
Severin Opel 28cfdc180c Fixt highlight order on creation. 2020-09-01 13:38:22 +02:00
Uwe Oestermeier 116058ba77 Fixed a problem with clicking transformed rects in card wrappers. 2020-08-27 07:38:35 +02:00
Uwe Oestermeier 4211548b8b Removed console logs. 2020-08-04 18:13:24 +02:00
Uwe Oestermeier 12b17fd7af Fixed call of popup menu commands with parameters.s 2020-08-04 18:07:48 +02:00
Uwe Oestermeier 47b178fbc1 Added event parameter to PopupMenu perform. 2020-08-04 17:35:15 +02:00
Severin Opel 6ab63eb32c Now calling 'this' to allow overloading of methods. 2020-04-21 12:43:55 +02:00
Severin Opel 6445ab3f57 CardLoader.load now checks for ready state. 2020-04-19 13:30:35 +02:00
Severin Opel 129672eb0f Added options object to toggle function. 2020-04-14 12:14:40 +02:00
Uwe Oestermeier 70031d3bfa Removed comment since border case appeared in Edge. 2020-02-25 15:19:01 +01:00
Uwe Oestermeier 9db5723746 Updated dist 2020-02-17 16:20:16 +01:00
Uwe Oestermeier d4ab5c7e9c Merge branch 'master' of https://gitea.iwm-tuebingen.de/IWMBrowser/iwmlib
* 'master' of https://gitea.iwm-tuebingen.de/IWMBrowser/iwmlib:
  Changed scale
  Updated to PixiJS 5.2.1.
2020-02-17 16:19:33 +01:00
Uwe Oestermeier b068fd176f Added lineWidth support. 2020-02-17 16:18:55 +01:00
Uwe Oestermeier f70968fe01 Changed scale 2020-02-07 20:08:44 +01:00
Sebastian Kupke 1c70433b86 Updated to PixiJS 5.2.1. 2020-02-04 16:48:36 +01:00
Uwe Oestermeier 54b685ab42 Changed calling order 2020-02-03 10:06:27 +01:00
Uwe Oestermeier e6f6f6b185 Changed calling order 2020-02-03 10:06:01 +01:00
Uwe Oestermeier 7bb3b696f7 Created new build. 2020-01-31 10:26:41 +01:00
Sebastian Kupke 6cdf5310ba Added graphics alpha workaround. 2020-01-30 15:41:31 +01:00
Sebastian Kupke 1967b791e0 Updated dependencies. 2020-01-22 13:50:40 +01:00
Sebastian Kupke ebb4b9154e Updated pixi-compressed-textures. 2020-01-20 11:33:53 +01:00
Sebastian Kupke b32132c71f Removed stopEvents from RigidContainer. 2020-01-10 14:18:28 +01:00
Sebastian Kupke f398fe4824 Fixed reference bug. 2020-01-09 15:14:27 +01:00
Severin Opel d5b87f23cf Updated generated content (Docs & dist). 2019-12-12 19:04:11 +01:00
Severin Opel 7f2fc93fa3 Reworked overlay itself and doctest. 2019-12-12 19:02:58 +01:00
Severin Opel 32e913c629 Fixed wrongly assigned parameters 2019-12-12 17:23:39 +01:00
Severin Opel 87c966062c Map's cover state now updates every time cover is requested. 2019-12-12 17:01:51 +01:00
Severin Opel d7f867f1a6 Added maps graphics. 2019-12-11 17:30:11 +01:00
Severin Opel e188f3474f Reverted index.css to previous version. 2019-12-11 16:52:23 +01:00
Severin Opel 1e80845aa6 Fixed cover bug. Renamed mapdata to mapprojection. 2019-12-11 16:45:26 +01:00
Severin Opel a85569e54d commited for presentation. 2019-12-11 15:29:59 +01:00
Severin Opel 65fac2f406 Renamed 'MapView' to 'MapViewport'. Added documentation to the maps module. 2019-12-09 18:15:28 +01:00
Severin Opel 60e28f8fe5 Improved doctest css. 2019-12-09 14:29:26 +01:00
Severin Opel 792892cb82 Removed PIXIUtils from geographics. 2019-12-09 14:27:32 +01:00
Severin Opel 9159073483 Fixed GeoGraphics doctest. 2019-12-05 17:06:50 +01:00
Severin Opel 8745554cee Implemented a mapChangeLock variable to prevent mapChanges. 2019-12-02 16:51:20 +01:00
Severin Opel 096e374997 Added mouse wheel event to submap scatter. 2019-11-28 16:25:38 +01:00
Severin Opel f3fed535d8 Modified scatter to get access to the Resize event. 2019-11-28 13:36:00 +01:00
Severin Opel 5305561619 Ongoing cleanup and refactoring of maps. 2019-11-25 18:04:11 +01:00
Severin Opel 88048f14ec Removed overdoscaling from SubmapScatter. 2019-11-21 09:48:14 +01:00
Severin Opel 4d6d2f1df0 Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2019-11-20 16:06:01 +01:00
Severin Opel 6dcf6d38da Added functionality and dark mode to doctests. And other changes in maps. 2019-11-20 15:59:10 +01:00
Sebastian Kupke 38e84ab9fe Updated dependencies. 2019-11-13 14:36:48 +01:00
Severin Opel 89395ba641 Updated mapapp. 2019-11-13 14:33:24 +01:00
Severin Opel 46b80c3e2a Added missing dependency to the iwmlib. 2019-11-13 14:30:15 +01:00
Severin Opel 285e41434a Continued refactoring of the maps library. 2019-11-13 12:42:06 +01:00
Severin Opel 58cbd44a7b Fixed map doctest. 2019-11-11 12:34:43 +01:00
Severin Opel ef16f2b12b Improved doctests. 2019-11-05 16:02:27 +01:00
Severin Opel 0a30712e31 Fixed overlay example to work with restructured GeoLayers. 2019-11-05 11:23:18 +01:00
Severin Opel 87727d28b9 Geographics placements working again. 2019-11-05 11:07:36 +01:00
Severin Opel ff0606d0a7 Removing layer dependency from geolayers and refactoring maps. 2019-11-04 18:20:32 +01:00
Severin Opel 938b3e2f3c Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2019-11-04 11:00:55 +01:00
Severin Opel 86b23f4e6f Added the maps-module to the iwmlib.
Migrated a  ot of the content from the tuesch to the iwmlib.
This is before the decoupeling of the layers.
2019-11-04 10:59:08 +01:00
Sebastian Kupke 06f8949159 Updated dependencies. 2019-11-04 09:45:10 +01:00
Sebastian Kupke e2ea89cc0b Added textAlpha and textActiveAlpha to Button and ButtonGroup. 2019-10-15 14:56:24 +02:00
Severin Opel e50ea6af31 Cleaned up card.js 2019-10-15 10:07:29 +02:00
Severin Opel 66da13aed6 Tried fixing closing error. 2019-10-15 09:12:12 +02:00
Sebastian Kupke 122493df19 Updated iwmlib. 2019-10-11 10:06:09 +02:00
Sebastian Kupke 6af487e5fd Updated dependencies. 2019-10-11 09:19:48 +02:00
Sebastian Kupke 99c128d7ca Added comments. 2019-10-10 09:16:39 +02:00
Sebastian Kupke 901621da95 Added PixiJS UI Text class. 2019-10-09 15:41:16 +02:00
Sebastian Kupke 125a418e79 Updated eslint. 2019-10-07 14:42:53 +02:00
Sebastian Kupke 680d0610b1 Removed console.log statements. 2019-10-02 15:05:18 +02:00
Sebastian Kupke ce25b1dbae Fixed flipeffect bug. 2019-10-02 15:00:08 +02:00
Sebastian Kupke 7dd7142455 Fixed flippable doctest. 2019-10-02 14:09:09 +02:00
Sebastian Kupke b4bc200fbd Styling. 2019-10-02 11:51:23 +02:00
Uwe Oestermeier 8960923514 Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2019-10-02 10:34:01 +02:00
Uwe Oestermeier cd140a73f6 Fixed taphandler problems. 2019-10-02 10:33:57 +02:00
Sebastian Kupke 980adbe595 Fixed clipping issue for PixiJS v5. 2019-10-02 09:27:12 +02:00
Severin Opel ba54969990 Fixed clipping issue for PIXI v5. 2019-10-01 15:40:55 +02:00
Sebastian Kupke cbe6613c56 Updated to PixiJS 5.1.5. 2019-09-30 10:10:03 +02:00
Sebastian Kupke e7c05a8387 Updated to PixiJS 5.1.4. 2019-09-23 14:00:31 +02:00
Sebastian Kupke 9dac52c0e4 Fixed DropShadowFilter. 2019-09-20 09:54:32 +02:00
Sebastian Kupke b09eb63785 Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib
# Conflicts:
#	dist/iwmlib.pixi.js
2019-09-19 16:47:44 +02:00
Sebastian Kupke 5556cc720c Revert. 2019-09-19 16:45:47 +02:00
Sebastian Kupke 735d947126 Fixed loader.js bug. 2019-09-19 13:53:12 +02:00
Sebastian Kupke b69472640f Reset line width. 2019-09-19 13:43:38 +02:00
Sebastian Kupke efbdffc6fc Fixed conflict. 2019-09-19 13:41:50 +02:00
Sebastian Kupke 5407f66aae Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib
# Conflicts:
#	dist/iwmlib.js
2019-09-19 13:40:42 +02:00
Sebastian Kupke 0e1b49675a Fixed loader bug. 2019-09-19 13:38:24 +02:00
Uwe Oestermeier 0e5be56dfe Fixed stylus line width problem. 2019-09-18 16:43:01 +02:00
Sebastian Kupke 71e5ce8b8e Fixed button bug with area interaction. 2019-09-17 15:14:57 +02:00
Sebastian Kupke 42afa3e7ab Added the option "capturePointerEvents" to InteractionDelegate. 2019-09-17 10:39:30 +02:00
Sebastian Kupke d3c8d9c1af Fixed README.md. 2019-09-11 09:51:14 +02:00
Sebastian Kupke 8fbd95ab77 Bump version to 1.1.0. 2019-09-11 09:44:55 +02:00
Sebastian Kupke 8034d3018a Generated JSDoc. 2019-09-11 09:42:00 +02:00
Sebastian Kupke ebe0b1253f Updated to PixiJS v5. 2019-09-10 16:34:59 +02:00
Severin Opel a775126f9c Fixed problem of popups showing up directly centered on highlights instead of over it. 2019-08-19 16:09:47 +02:00
Severin Opel 28a7a0b6a2 Fixed closing issue with cards. 2019-08-14 17:46:12 +02:00
Severin Opel 30c7113713 Updated cards from tuesch changes. Incorporated InteractionMapper memory leak fix. 2019-08-13 14:31:03 +02:00
Sebastian Kupke 03be6673c5 Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2019-08-13 12:46:32 +02:00
Sebastian Kupke 6e9ec938fc Implemented InteractionMapper.off 2019-08-13 12:46:24 +02:00
Severin Opel 6841a52024 Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2019-08-12 16:35:26 +02:00
Severin Opel 1d94455c1a Cleanup transform listeners properly now. 2019-08-12 16:35:10 +02:00
Sebastian Kupke e7bda6af17 Added memory test with Hammerjs destroy. 2019-08-12 15:57:21 +02:00
Severin Opel 98b3b44ed5 Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2019-08-12 15:57:14 +02:00
Sebastian Kupke 7f5e0e8e79 Added Hammerjs memory test. 2019-08-12 15:38:03 +02:00
Sebastian Kupke 74b5d69389 Added EventListener test. 2019-08-12 12:16:05 +02:00
Severin Opel 4f4215ced5 Close callbacks on Scatter are now removed on close. 2019-08-12 10:04:03 +02:00
Sebastian Kupke 53654349b5 Changed prettier printWidth in build script. 2019-08-09 10:27:08 +02:00
Sebastian Kupke 3cb389aabd Merge branch 'master' of https://gitea.iwm-tuebingen.de/IWMBrowser/iwmlib 2019-08-08 14:33:03 +02:00
Sebastian Kupke d48139c40f Fixed positioning bug in button. 2019-08-08 14:32:55 +02:00
Uwe Oestermeier 05e3c89ca1 Fixed eslint problems 2019-08-08 14:30:42 +02:00
Sebastian Kupke f5cf8115af Fixed conflict. 2019-08-08 13:47:00 +02:00
Sebastian Kupke 97d33cf177 Fixed theming bug in button and button group. 2019-08-08 13:46:02 +02:00
Uwe Oestermeier 7e7b37f524 Merge branch 'master' of https://gitea.iwm-tuebingen.de/IWMBrowser/iwmlib 2019-08-08 12:06:27 +02:00
Uwe Oestermeier 9aef7bb460 Timeline is now draggable 2019-08-08 12:06:16 +02:00
Sebastian Kupke cdc6461064 Prevent dragging of button group if buttons are not wider than maxWidth. 2019-08-07 15:24:18 +02:00
Sebastian Kupke 56910a8c58 Fixed vertical button group bug. 2019-08-07 15:03:58 +02:00
Sebastian Kupke caffee4b15 Fixed button group bug. 2019-08-07 14:57:07 +02:00
Sebastian Kupke 141d27d4f1 Added path to gulpfile. 2019-08-06 15:34:57 +02:00
Sebastian Kupke a42427f987 Improved button doctest. 2019-08-06 14:24:50 +02:00
Sebastian Kupke 05c952fbe1 Added badge content example to button doctest. 2019-08-06 12:01:32 +02:00
Sebastian Kupke ca16516073 Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2019-08-05 11:45:09 +02:00
Sebastian Kupke 03f927d1d5 Set window.app as default value for button group option "app". 2019-08-05 11:44:59 +02:00
Uwe Oestermeier e502c97de5 Added prepare method 2019-08-03 09:02:58 +02:00
Sebastian Kupke a44fd6c469 Removed d3 from globals. 2019-08-02 11:39:56 +02:00
Sebastian Kupke e8a64fb014 Added getter and setter for maxWidth and maxHeight for button groups. 2019-08-02 10:15:49 +02:00
Uwe Oestermeier 81e21736b7 Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2019-08-01 19:34:49 +02:00
Uwe Oestermeier 488c1807d6 Improved card API. 2019-08-01 19:34:32 +02:00
Uwe Oestermeier 0182e9663e Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2019-08-01 19:31:22 +02:00
Uwe Oestermeier db2badfc0d Added event parameter, 2019-08-01 19:30:07 +02:00
Sebastian Kupke 1e3f66bb19 Fixed button hover bug. 2019-08-01 14:27:04 +02:00
Sebastian Kupke 32087608cc Improved button group stack sorting. 2019-08-01 11:26:22 +02:00
Sebastian Kupke b1f0f173e7 Fixed bug with stacked buttons in a button group with badges. 2019-08-01 10:31:05 +02:00
Sebastian Kupke e9f1246e0a Improved button group stacking behaviour if ThrowPropsPlugin is not loaded. 2019-08-01 10:19:34 +02:00
Sebastian Kupke 56407539aa Updated docs. 2019-08-01 09:51:32 +02:00
Sebastian Kupke a6f0341fe4 Added huge button group example. 2019-08-01 09:44:03 +02:00
Sebastian Kupke afa1c71a0a Added badge examples for buttons and button groups. 2019-08-01 09:42:04 +02:00
Sebastian Kupke dafc820466 Fixed html bug. 2019-07-31 16:12:15 +02:00
Sebastian Kupke 614b4d8350 Implemented stacked button groups. 2019-07-31 16:12:00 +02:00
Sebastian Kupke 73342a0506 Merged conflicts. 2019-07-30 17:12:17 +02:00
Sebastian Kupke c55644558a Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib
# Conflicts:
#	lib/scatter.js
2019-07-30 17:02:58 +02:00
Sebastian Kupke 5f46b4feae Working on stacked buttons. 2019-07-30 16:56:29 +02:00
Severin Opel ca2ce289aa Improved scatter closing. Added module to eslint. 2019-07-30 13:21:17 +02:00
Severin Opel 0bcf931465 Added remove capability to scatter.(Merged local branch 'scatter') 2019-07-29 16:18:20 +02:00
Severin Opel 5e98640ded Added a remove function for the DOMScatterContainer. Is automatically called onClose. 2019-07-29 14:36:00 +02:00
Uwe Oestermeier e72836e0f7 Fixed highlight problems 2019-07-24 12:45:55 +02:00
Uwe Oestermeier ed40ffc43f Improved wrapper event handling. 2019-07-24 11:45:03 +02:00
Uwe Oestermeier cc6ef8de46 Tested new way to compute interaction delta. 2019-07-24 08:54:09 +02:00
Uwe Oestermeier ef4267e926 Improved click handling 2019-07-21 21:42:03 +02:00
Uwe Oestermeier e32ee93e7a Improved zoom behavior. 2019-07-19 15:30:13 +02:00
Uwe Oestermeier 51dd0ef4ba Disable zoom correction. 2019-07-19 15:25:47 +02:00
Uwe Oestermeier dcd5acb4d1 Generalized the min rotation to min interaction distance. 2019-07-19 15:21:47 +02:00
Uwe Oestermeier bb0dcf2d9d Improved handling of min rotation distance. 2019-07-19 15:19:03 +02:00
Uwe Oestermeier dfe7c0a011 Rebuild dist. 2019-07-19 15:13:31 +02:00
Uwe Oestermeier 68c98d1293 Added check for rotation by narrow distance between touch points. 2019-07-19 15:05:46 +02:00
Uwe Oestermeier ff2c15a505 Added material icons. 2019-07-19 10:18:15 +02:00
Uwe Oestermeier 4e9aa716bd Added images 2019-07-19 09:41:02 +02:00
Uwe Oestermeier 8d8e764956 Added default css for cards. 2019-07-19 09:31:25 +02:00
Uwe Oestermeier bb660b0e04 Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2019-07-19 08:39:08 +02:00
Uwe Oestermeier a4de98a0e7 Centered image. 2019-07-19 08:39:01 +02:00
Sebastian Kupke 2d400a18ec Prettified all files. 2019-07-18 12:26:39 +02:00
Sebastian Kupke 7744b92771 Prettified badge.js. 2019-07-18 08:59:39 +02:00
Sebastian Kupke 5704beaad4 Fixed build problem. 2019-07-18 08:52:46 +02:00
Uwe Oestermeier 0f4949b0ae Fixed order of gulp imports. 2019-07-18 08:40:48 +02:00
Uwe Oestermeier 774f5989ec Added support for hyphenation including jquery dependency. 2019-07-18 08:36:25 +02:00
Uwe Oestermeier 9abea054b7 Minor changes. 2019-07-17 11:54:10 +02:00
Uwe Oestermeier 3c607200be Added popup example. 2019-07-17 11:41:33 +02:00
Uwe Oestermeier d506eed827 Fixed bundle problems 2019-07-17 11:03:26 +02:00
Sebastian Kupke 7f00898767 Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib
# Bitte geben Sie eine Commit-Beschreibung ein, um zu erklären, warum dieser
# Merge erforderlich ist, insbesondere wenn es einen aktualisierten
# Upstream-Branch mit einem Thema-Branch zusammenführt.
#
# Zeilen, die mit '#' beginnen, werden ignoriert,
# und eine leere Beschreibung bricht den Commit ab.
Merged.
2019-07-17 10:06:26 +02:00
Sebastian Kupke 7f909c9f59 Added htmlhint. 2019-07-17 10:04:59 +02:00
Uwe Oestermeier ab835d6fc3 Removed TweenMax dependency 2019-07-17 10:04:16 +02:00
Uwe Oestermeier 17bbe1a90e Added files to make classes better accessible. 2019-07-17 09:56:20 +02:00
Sebastian Kupke 78108c4090 Linted gulpfile. 2019-07-16 15:10:15 +02:00
Sebastian Kupke 3c8f0bac1b Added stylelint. 2019-07-16 14:07:16 +02:00
Sebastian Kupke 87b63c2142 Added ESLint and Prettier. 2019-07-16 13:54:04 +02:00
Uwe Oestermeier 1f5df65c48 Added tests for jQuery. 2019-07-16 10:04:25 +02:00
Uwe Oestermeier 09b50d3b81 Bundled card classes. 2019-07-16 09:27:48 +02:00
Uwe Oestermeier 54912ad37e Moved files from src/htmlcards to iwmlib. 2019-07-16 09:21:28 +02:00
Uwe Oestermeier 9a399ecfe9 Fixed highlight doctest. 2019-07-15 14:42:01 +02:00
Uwe Oestermeier c3477244b9 Working on cards. 2019-07-15 13:32:45 +02:00
Uwe Oestermeier 0e8c62eb4b Minor updates to Doctests. 2019-07-12 14:50:30 +02:00
Uwe Oestermeier e1b5c45b52 Added support for DOM cards. 2019-07-12 14:33:15 +02:00
Uwe Oestermeier d04f92ee7f Added smoothing parameter to DOMScatter 2019-07-11 16:08:49 +02:00
Uwe Oestermeier cd76ae22a4 Added LowPassFilter and support for smooth scatter rotation and zoom. 2019-07-11 15:41:03 +02:00
Uwe Oestermeier 2a11f02bd2 Added missing update of dist script. 2019-07-10 14:29:44 +02:00
Uwe Oestermeier 42539c9d95 Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2019-07-10 14:21:07 +02:00
Uwe Oestermeier 6e77f0ec58 Added test for null in Timeline.onMove 2019-07-10 14:20:58 +02:00
Sebastian Kupke 1c7651f0d5 Generated JSDoc. 2019-07-10 11:55:35 +02:00
Sebastian Kupke 44a5b3385c Fixed #17. 2019-07-08 15:44:06 +02:00
Uwe Oestermeier 1e17184194 Fixed wording 2019-07-08 09:58:27 +02:00
Uwe Oestermeier 808106262e Removed setup from constructor to simplify specializations 2019-07-08 09:07:26 +02:00
Uwe Oestermeier b36d75af46 Removed setup from constructor to simplify specializations 2019-07-08 09:05:54 +02:00
Uwe Oestermeier d0c89a78c2 Added flag to enable tap clicks for SVG in tested circumstances. 2019-07-05 16:29:50 +02:00
Uwe Oestermeier f68d8b53a3 Using original click events for SVG elements. Must be checked for taps on touch devices. 2019-07-05 16:11:23 +02:00
Uwe Oestermeier 84ea33f029 Added click handler to avoid double calls of click event handler. 2019-07-05 15:03:22 +02:00
Uwe Oestermeier 6392e4b13a Improved click behavior 2019-07-05 14:40:35 +02:00
Uwe Oestermeier 14f2c2fbe6 Improved tab behavior of scatter 2019-07-05 14:40:15 +02:00
Uwe Oestermeier a77226e42b Working on scatter doctest 2019-07-05 14:12:49 +02:00
Uwe Oestermeier 8b4c6c2014 Fixed doctest problems. 2019-07-05 14:11:43 +02:00
Sebastian Kupke 4009ddd422 Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib
# Conflicts:
#	dist/iwmlib.js
2019-07-05 13:58:20 +02:00
Sebastian Kupke 6794c5eedd Fixed conflict. 2019-07-05 13:57:52 +02:00
Uwe Oestermeier 20ac5c387e Working on tap behavior of scatter and flippables. 2019-07-05 13:43:39 +02:00
Uwe Oestermeier 30e998e386 Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2019-07-05 09:39:17 +02:00
Uwe Oestermeier e87c8c9e1e Renamed simulateClick to clickOnTap 2019-07-05 09:39:01 +02:00
Sebastian Kupke 92d3c0c861 Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib
# Conflicts:
#	dist/iwmlib.js
2019-07-05 09:36:57 +02:00
Sebastian Kupke 0c190f1f76 Fixed flippable doctest. 2019-07-05 09:34:22 +02:00
Uwe Oestermeier a3f7eb0b3c Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2019-07-05 09:18:13 +02:00
Uwe Oestermeier 4f35bfd51f Fixed eslint problems and cleaned DOMScatter.onTap code 2019-07-05 09:17:52 +02:00
Sebastian Kupke fc6b30f03c Fixed some linter problems. 2019-07-05 08:43:23 +02:00
Sebastian Kupke 22b0ceaff7 Improved gitignore. 2019-07-05 08:36:40 +02:00
Sebastian Kupke 357153b978 Added lint files. 2019-07-05 08:35:32 +02:00
Uwe Oestermeier 5d1408ad9a Fixed minor bug. 2019-07-04 16:15:12 +02:00
Uwe Oestermeier 9b9988569f Added limit to scatter rotation to avoid flicker. 2019-07-04 16:08:23 +02:00
Uwe Oestermeier dda6262601 Added maxRotation parameter. 2019-07-04 16:00:56 +02:00
Uwe Oestermeier 6e4e847be1 Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2019-07-04 11:02:33 +02:00
Sebastian Kupke 03d8eef5ae Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2019-07-04 09:19:13 +02:00
Sebastian Kupke 4e9dd2fa02 Fixed worker path problems. 2019-07-04 09:17:43 +02:00
Uwe Oestermeier dcf40822e3 Added links 2019-07-04 09:16:50 +02:00
Uwe Oestermeier b6fc04a411 Uups, forgot to remove files. 2019-07-04 09:09:58 +02:00
Uwe Oestermeier af932a9911 Removed the stylus folder and added stylus.js with doctest to lib/pixi 2019-07-04 09:09:19 +02:00
Sebastian Kupke da212ac188 Changed README. 2019-07-03 13:49:59 +02:00
Sebastian Kupke 3436b9edbf Fixed version number. 2019-07-03 13:46:52 +02:00
Uwe Oestermeier 8a4f64f545 Fixed eslint problems 2019-07-02 10:06:23 +02:00
Uwe Oestermeier 1480ad8145 Logging handlers can now be adapted to special needs 2019-07-02 09:38:19 +02:00
Uwe Oestermeier 9042579518 Removed unused import 2019-06-24 10:50:51 +02:00
Uwe Oestermeier 11bc20fad5 Improved ticks. 2019-06-21 12:28:52 +02:00
Uwe Oestermeier 8b9ed733dd Added missing variables. 2019-06-18 16:07:07 +02:00
Uwe Oestermeier 5c95128dfc Bump version number. 2019-06-18 16:02:24 +02:00
Uwe Oestermeier beca78d7a7 Improved handling of textures that arrive too late. 2019-06-18 16:01:20 +02:00
Uwe Oestermeier 54a1e74e27 Added message cache to prevent error overflows. 2019-06-18 09:00:05 +02:00
Uwe Oestermeier 909ef9d242 Added persistent logging methods 2019-06-17 17:21:47 +02:00
Uwe Oestermeier 6ec0e9631a Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2019-06-06 16:18:05 +02:00
Uwe Oestermeier 6f7a18d6b8 Fixed line endings 2019-06-06 16:17:58 +02:00
mhalfmann 322fdf8deb Revert "highlightColor for popup now being set correctly"
This reverts commit 012fe4bc4a.
2019-06-06 15:14:24 +02:00
mhalfmann 012fe4bc4a highlightColor for popup now being set correctly 2019-06-06 15:13:55 +02:00
mhalfmann 502bdf47a3 Revert "highlightColor now set correctly"
This reverts commit 437320b4ad.
2019-06-06 15:09:56 +02:00
mhalfmann 437320b4ad highlightColor now set correctly 2019-06-06 14:47:41 +02:00
Uwe Oestermeier 3b6402a682 Removed pending state since it seems no longer necessary. 2019-06-04 13:09:38 +02:00
Uwe Oestermeier fa25d13469 Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2019-06-04 09:35:00 +02:00
Uwe Oestermeier 4c08359394 Added active flag to avoid transform of inactive deepzoom images. 2019-06-04 09:34:50 +02:00
mhalfmann b5400c8223 fixed resize function 2019-06-04 08:43:07 +02:00
Manfred Knobloch 5a336e8d40 regenerated pngs 2019-06-03 11:41:18 +02:00
Manfred Knobloch 2d1a6b1b7f Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2019-06-03 11:39:54 +02:00
Manfred Knobloch 636e2e439c typo fixed 2019-06-03 11:39:33 +02:00
Sebastian Kupke b208592e3a Version 1.0.12. 2019-06-03 10:53:33 +02:00
Uwe Oestermeier 95d1941545 Disabled debug flag. 2019-06-03 10:49:56 +02:00
Uwe Oestermeier 086dfff19e Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2019-06-03 10:24:36 +02:00
Uwe Oestermeier 0442df4287 Reverting getBounds to bound to avoid excessive loading of tiles. 2019-06-03 10:24:10 +02:00
Manfred Knobloch e3d167bd7f concluded merge 2019-06-03 09:46:24 +02:00
Manfred Knobloch da5ed78558 added fs-extra to have ensure-dir for non existing dirs 2019-06-03 09:42:45 +02:00
Uwe Oestermeier 0c46c4e656 Fixed minor problems. 2019-06-03 08:55:33 +02:00
Uwe Oestermeier 304818dc13 Fixed typos. 2019-06-01 12:40:01 +02:00
Uwe Oestermeier 05ecd0b048 Fixed minor bugs 2019-06-01 12:31:38 +02:00
Uwe Oestermeier 895ec55a46 Added support for keeping a limited set of tile textures. 2019-06-01 09:56:29 +02:00
Uwe Oestermeier 67c6a6c95c Correct version number 2019-05-31 16:21:50 +02:00
Uwe Oestermeier 107529f844 Added warning to Tile.destroy 2019-05-31 16:10:46 +02:00
Uwe Oestermeier f39b7ae14a Adding a return value in boundary condition. 2019-05-31 15:32:13 +02:00
Manfred Knobloch aafa528f03 Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2019-05-31 13:59:02 +02:00
Manfred Knobloch e3f903cd48 current state 2019-05-31 13:58:24 +02:00
Manfred Knobloch 777fe83257 added bin dir 2019-05-31 13:57:43 +02:00
Uwe Oestermeier 8752d47e01 Fixed velocity computation in Throwable 2019-05-31 10:15:50 +02:00
Uwe Oestermeier cc49df6e55 Increased version number 2019-05-31 10:01:55 +02:00
Uwe Oestermeier 5b3586d8de Increased version number 2019-05-31 09:54:11 +02:00
Uwe Oestermeier d0d3a7f134 Fixed throwing problems with 2+ pointers 2019-05-31 09:51:01 +02:00
Uwe Oestermeier d114edc1e2 Removed obsolete comments. 2019-05-31 06:31:09 +02:00
Manfred Knobloch b26a5e902c testrunner first version 2019-05-29 14:24:39 +02:00
Manfred Knobloch 6678af412d Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2019-05-28 13:55:03 +02:00
Manfred Knobloch 34872d6b8b added testrunner current version supports screen dump of html page as png 2019-05-28 13:54:50 +02:00
Sebastian Kupke d7745f908f Updated README.md. 2019-05-27 15:46:09 +02:00
Sebastian Kupke 38a2498494 Fixed DeepZoom bounds bug. 2019-05-27 15:42:55 +02:00
Sebastian Kupke 8c513b624a Updated to Greensock-Max files. 2019-05-27 11:01:48 +02:00
Sebastian Kupke 0cfd64318f Fixed UiTest bug. 2019-05-27 10:53:51 +02:00
Sebastian Kupke ab1ad48608 Fixed missing D3 bug. 2019-05-24 14:38:03 +02:00
Sebastian Kupke d6f9c012e9 Fixed Flippable bug. 2019-05-24 14:35:37 +02:00
Sebastian Kupke c8e2bea8fa Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2019-05-24 11:02:52 +02:00
Sebastian Kupke 16635078ac Fixed logging bug. 2019-05-24 11:02:44 +02:00
Uwe Oestermeier d615158cf9 Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2019-05-24 11:00:38 +02:00
Uwe Oestermeier f5faa6da5e Disabled cancelOnWindowOut because it posed problems on Safari Technology Preview 2019-05-24 11:00:29 +02:00
Sebastian Kupke b140f0aaab Updated package.json. 2019-05-24 10:33:32 +02:00
Sebastian Kupke 35773f4a18 Further developed logging for electron. 2019-05-24 10:29:10 +02:00
Uwe Oestermeier 7f4b7fb1ff Added logging module 2019-05-24 09:53:27 +02:00
Uwe Oestermeier becb749e02 Added logInteractionsAbove limit 2019-05-24 09:21:02 +02:00
Manfred Knobloch a2711a735d adapted references, removed references to all.js 2019-05-23 11:21:46 +02:00
Manfred Knobloch 190d28b6df repair doctests - not yet finished 2019-05-22 16:03:19 +02:00
Manfred Knobloch c0d51af664 cleanup doctests - not finished 2019-05-22 16:02:17 +02:00
Sebastian Kupke 51bd9cf170 Removed the material-design dependency. 2019-05-21 13:58:26 +02:00
Sebastian Kupke cdf331463e Reduced file size of assets. 2019-05-21 13:33:02 +02:00
Sebastian Kupke 679ab49047 Improved docs. 2019-05-14 14:30:12 +02:00
Sebastian Kupke 919c8733a0 Fixed display bug. 2019-05-14 14:13:37 +02:00
Sebastian Kupke be00453f2c Added jsdoc for Scrollview. 2019-05-14 14:03:32 +02:00
Sebastian Kupke 275a5d0b04 Added Scrollview. 2019-05-14 13:56:05 +02:00
Sebastian Kupke fada4f9a9d Merge branch 'pixijs-v5'
* pixijs-v5:
  Merged versions for PixiJS 4 and 5.
  Adjustments for Pixi.JS 5.0.
2019-05-14 11:55:22 +02:00
Sebastian Kupke 08a9dbdf1d Merged versions for PixiJS 4 and 5. 2019-05-14 11:54:25 +02:00
Uwe Oestermeier 06e69d86b6 Added throwDaping instance variable to fix throw behavior 2019-05-14 09:57:28 +02:00
Sebastian Kupke 06aec0308d Adjustments for Pixi.JS 5.0. 2019-04-30 12:18:36 +02:00
Sebastian Kupke b07d76ce1d Removed sourcmapping URLs in build script. 2019-04-16 12:16:29 +02:00
Sebastian Kupke b3902fbcb1 Fixed version number. 2019-04-11 11:37:27 +02:00
Sebastian Kupke d2fc9820b2 Added icons. 2019-04-11 11:28:43 +02:00
Sebastian Kupke 1fbbbbe9a9 Removed link to pixi-projection map file. 2019-04-11 10:59:52 +02:00
Sebastian Kupke e4a1b9d63b Updated version number. 2019-04-09 10:57:28 +02:00
mhalfmann 31186d99a6 fixed bug when resizing scaled pads 2019-04-08 12:31:50 +02:00
Sebastian Kupke cf48fce4ff Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2019-04-05 11:13:42 +02:00
Sebastian Kupke 7536ff56a6 Updated version number. 2019-04-05 11:13:34 +02:00
mhalfmann fc23c2fc56 fixed path in stylus.js 2019-04-05 10:49:16 +02:00
mhalfmann 9386ff06fe added stylus 2019-04-05 10:09:45 +02:00
mhalfmann bbea6e4ae2 added bootstrap 3rd party dependencies 2019-04-05 10:09:27 +02:00
Sebastian Kupke 6ff819d917 Fixed bug in README.md. 2019-03-29 15:07:28 +01:00
Sebastian Kupke 27db37d21d Improved README.md. 2019-03-29 15:06:07 +01:00
Sebastian Kupke 3ca25b3e93 Corrected preventDefault with mousewheel in PixiJS List. 2019-03-29 15:01:21 +01:00
Sebastian Kupke f84d554a69 Updated docs. 2019-03-29 11:44:34 +01:00
Sebastian Kupke 1292fd23f0 Added mousewheel support for PixiJS Lists. 2019-03-29 11:40:01 +01:00
Sebastian Kupke 6c2ae3b433 Removed Greensock ThrowPropsPlugin as an dependency. 2019-03-29 09:11:21 +01:00
Sebastian Kupke fe36b66dc5 Included jsdoc. 2019-03-29 08:49:53 +01:00
Sebastian Kupke 5a963844d8 Fixed jsdoc in labelgraphics.js. 2019-03-29 08:48:03 +01:00
Uwe Oestermeier 909c67cfba Added text that zooms vis font size changes, 2019-03-28 09:49:21 +01:00
Sebastian Kupke df0c2fea3a Removed jQuery and D3 dependencies. 2019-03-28 09:37:30 +01:00
Sebastian Kupke 85e7da252f Updated PixiJS. 2019-03-28 09:02:53 +01:00
Sebastian Kupke 2a7f76ed8d Changed 3rd party structure using node_modules. 2019-03-22 15:14:11 +01:00
Sebastian Kupke 8c43840572 Create 3rd party libraries with node instead of Python. 2019-03-22 14:26:44 +01:00
Sebastian Kupke b164de08a5 Added minified version. 2019-03-22 13:48:42 +01:00
Sebastian Kupke d1efeeffa6 Restructured library. 2019-03-22 12:54:57 +01:00
Sebastian Kupke 1bc2deb4d3 Adjusted .gitignore. 2019-03-22 12:18:16 +01:00
Uwe Oestermeier bef066abda Fixed bug for Safari Technology Review pointer events 2019-03-22 11:59:28 +01:00
Sebastian Kupke 155556ec6e Fixed broken link. 2019-03-21 10:09:46 +01:00
3475 changed files with 479799 additions and 327795 deletions
+2
View File
@@ -0,0 +1,2 @@
dist/*
doc/out/*
+32
View File
@@ -0,0 +1,32 @@
{
"parserOptions": {
"ecmaVersion": 10,
"sourceType": "module",
"ecmaFeatures": {
"impliedStrict": true,
"modules": true
}
},
"env": {
"browser": true,
"es6": true,
"node": true,
"jquery": true,
"worker": true,
"mocha": true,
"serviceworker": true
},
"globals": {
"PIXI": false,
"TweenLite": false,
"TweenMax": false,
"TimelineLite": false,
"TimelineMax": false,
"SystemJS": false,
"app": true
},
"plugins": [
"prettier"
],
"extends": ["eslint:recommended", "plugin:prettier/recommended"]
}
+7 -2
View File
@@ -76,6 +76,11 @@ typings/
# FuseBox cache # FuseBox cache
.fusebox/ .fusebox/
#own # own
lib.code-workspace .history/
.vscode/
# ignore generated contents-
/doc/out/*
**/thumbnails
**/thumbnail.png
+3
View File
@@ -0,0 +1,3 @@
{
}
+7
View File
@@ -0,0 +1,7 @@
{
"singleQuote": true,
"jsxSingleQuote": true,
"tabWidth": 4,
"semi": false,
"printWidth": 120
}
+3
View File
@@ -0,0 +1,3 @@
dist/*
doc/*
lib/*
+11
View File
@@ -0,0 +1,11 @@
{
"extends": "stylelint-config-standard",
"rules": {
"indentation": 4,
"selector-list-comma-newline-after": "never-multi-line",
"no-eol-whitespace": [true, {
"ignore": ["empty-lines"]
}]
},
"ignoreFiles": []
}
+26
View File
@@ -0,0 +1,26 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}\\index.js"
},
{
"type": "node",
"request": "launch",
"name": "testrunner",
"program": "${workspaceFolder}\\bin\\testrunner.js"
},
{
"type": "node",
"request": "launch",
"name": "single",
"program": "${workspaceFolder}\\bin\\singleshot.js"
}
]
}
-45
View File
@@ -1,45 +0,0 @@
/*
* Import often used libraries.
*/
import './jquery.js'
import './optimal-select.js'
import './hammer.js'
import './d3/d3.v4.js'
import './d3/d3.v4.selection-multi.js'
import './highlight/highlight.pack.js'
import './pixi/pixi.js'
import './pixi/pixi-filters.js'
import './pixi/pixi-particles.js'
import './pixi/pixi-compressed-textures.js'
import './greensock/src/uncompressed/jquery.gsap.js'
import './greensock/src/uncompressed/TweenLite.js'
import './greensock/src/uncompressed/TweenMax.js'
import './greensock/src/uncompressed/TimelineLite.js'
import './greensock/src/uncompressed/TimelineMax.js'
import './greensock/src/uncompressed/easing/CustomBounce.js'
import './greensock/src/uncompressed/easing/CustomEase.js'
import './greensock/src/uncompressed/easing/CustomWiggle.js'
import './greensock/src/uncompressed/easing/EasePack.js'
import './greensock/src/uncompressed/plugins/AttrPlugin.js'
import './greensock/src/uncompressed/plugins/BezierPlugin.js'
import './greensock/src/uncompressed/plugins/ColorPropsPlugin.js'
import './greensock/src/uncompressed/plugins/CSSPlugin.js'
import './greensock/src/uncompressed/plugins/CSSRulePlugin.js'
import './greensock/src/uncompressed/plugins/DirectionalRotationPlugin.js'
import './greensock/src/uncompressed/plugins/DrawSVGPlugin.js'
import './greensock/src/uncompressed/plugins/EaselPlugin.js'
import './greensock/src/uncompressed/plugins/EndArrayPlugin.js'
import './greensock/src/uncompressed/plugins/ModifiersPlugin.js'
import './greensock/src/uncompressed/plugins/MorphSVGPlugin.js'
import './greensock/src/uncompressed/plugins/Physics2DPlugin.js'
import './greensock/src/uncompressed/plugins/PhysicsPropsPlugin.js'
import './greensock/src/uncompressed/plugins/PixiPlugin.js'
import './greensock/src/uncompressed/plugins/RaphaelPlugin.js'
import './greensock/src/uncompressed/plugins/RoundPropsPlugin.js'
import './greensock/src/uncompressed/plugins/ScrambleTextPlugin.js'
import './greensock/src/uncompressed/plugins/ScrollToPlugin.js'
import './greensock/src/uncompressed/plugins/TEMPLATE_Plugin.js'
import './greensock/src/uncompressed/plugins/TextPlugin.js'
import './greensock/src/uncompressed/plugins/ThrowPropsPlugin.js'
import './greensock/src/uncompressed/utils/Draggable.js'
import './greensock/src/uncompressed/utils/SplitText.js'
-44
View File
@@ -1,44 +0,0 @@
convertPointFromPageToNode.js
https://gist.github.com/Yaffle/1145197
No Licence ==> All Rights Reserved
D3
https://github.com/d3/d3/blob/master/LICENSE
A permissive license similar to the BSD 2-Clause License, but with a 3rd clause that prohibits others from using the name of the project or its contributors to promote derived products without written consent.
Dexie
https://github.com/dfahlander/Dexie.js/blob/master/LICENSE
Apache License 2.0
Greensock
https://greensock.com/licensing
Standard No Charge license allows commercial one-off project. Multiple installations require the "Business Green" license.
Gun DB
https://github.com/amark/gun/blob/master/LICENSE.md
Apache License, Version 2.0
Pixie
https://github.com/usmanhalalit/pixie/blob/master/LICENSE
MIT License
jQuery
https://github.com/jquery/jquery/blob/master/LICENSE.txt
BSD style
PDF
Apache License, Version 2.0
-28
View File
@@ -1,28 +0,0 @@
# Patches
A listing of all manual changes of 3rdparty files.
## PIXI.js
+ Ensure that a minimal compressed texture example is working and apply changes to deepzoom.js~~ => Patched in pixi.js (Line 5794). + Changed:
```javascript
if (status === STATUS_NONE && text.length > 0)) {`
```
to
```javascript
if (status === STATUS_NONE && (text.length > 0 || xhr.responseURL.endsWith
('.dds'))) { // PATCH: Kupke, 07.08.2017`
```
+ Loading SVG Textures from filesystem
+ Problem: In PIXI 4.7.0 the XHTTP Request of PIXI, when loading an SVG from the filesystem returned an error message and prevented the svg from being displayed.
+ Solution: Just suppress the error when on local filesystem.
+ Location: *BaseTexture.prototype._loadSvgSourceUsingXhr*
```javascript
if(window.location.protocol !== "file:"){ // This condition was added.
if (svgXhr.readyState !== svgXhr.DONE || svgXhr.status !== 200) {
throw new Error('Failed to load SVG using XHR.');
}
}
```
-133700
View File
File diff suppressed because one or more lines are too long
-66
View File
@@ -1,66 +0,0 @@
.CodeMirror-simplescroll-horizontal div, .CodeMirror-simplescroll-vertical div {
position: absolute;
background: #ccc;
-moz-box-sizing: border-box;
box-sizing: border-box;
border: 1px solid #bbb;
border-radius: 2px;
}
.CodeMirror-simplescroll-horizontal, .CodeMirror-simplescroll-vertical {
position: absolute;
z-index: 6;
background: #eee;
}
.CodeMirror-simplescroll-horizontal {
bottom: 0; left: 0;
height: 8px;
}
.CodeMirror-simplescroll-horizontal div {
bottom: 0;
height: 100%;
}
.CodeMirror-simplescroll-vertical {
right: 0; top: 0;
width: 8px;
}
.CodeMirror-simplescroll-vertical div {
right: 0;
width: 100%;
}
.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler, .CodeMirror-overlayscroll .CodeMirror-gutter-filler {
display: none;
}
.CodeMirror-overlayscroll-horizontal div, .CodeMirror-overlayscroll-vertical div {
position: absolute;
background: #bcd;
border-radius: 3px;
}
.CodeMirror-overlayscroll-horizontal, .CodeMirror-overlayscroll-vertical {
position: absolute;
z-index: 6;
}
.CodeMirror-overlayscroll-horizontal {
bottom: 0; left: 0;
height: 6px;
}
.CodeMirror-overlayscroll-horizontal div {
bottom: 0;
height: 100%;
}
.CodeMirror-overlayscroll-vertical {
right: 0; top: 0;
width: 6px;
}
.CodeMirror-overlayscroll-vertical div {
right: 0;
width: 100%;
}
-152
View File
@@ -1,152 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
function Bar(cls, orientation, scroll) {
this.orientation = orientation;
this.scroll = scroll;
this.screen = this.total = this.size = 1;
this.pos = 0;
this.node = document.createElement("div");
this.node.className = cls + "-" + orientation;
this.inner = this.node.appendChild(document.createElement("div"));
var self = this;
CodeMirror.on(this.inner, "mousedown", function(e) {
if (e.which != 1) return;
CodeMirror.e_preventDefault(e);
var axis = self.orientation == "horizontal" ? "pageX" : "pageY";
var start = e[axis], startpos = self.pos;
function done() {
CodeMirror.off(document, "mousemove", move);
CodeMirror.off(document, "mouseup", done);
}
function move(e) {
if (e.which != 1) return done();
self.moveTo(startpos + (e[axis] - start) * (self.total / self.size));
}
CodeMirror.on(document, "mousemove", move);
CodeMirror.on(document, "mouseup", done);
});
CodeMirror.on(this.node, "click", function(e) {
CodeMirror.e_preventDefault(e);
var innerBox = self.inner.getBoundingClientRect(), where;
if (self.orientation == "horizontal")
where = e.clientX < innerBox.left ? -1 : e.clientX > innerBox.right ? 1 : 0;
else
where = e.clientY < innerBox.top ? -1 : e.clientY > innerBox.bottom ? 1 : 0;
self.moveTo(self.pos + where * self.screen);
});
function onWheel(e) {
var moved = CodeMirror.wheelEventPixels(e)[self.orientation == "horizontal" ? "x" : "y"];
var oldPos = self.pos;
self.moveTo(self.pos + moved);
if (self.pos != oldPos) CodeMirror.e_preventDefault(e);
}
CodeMirror.on(this.node, "mousewheel", onWheel);
CodeMirror.on(this.node, "DOMMouseScroll", onWheel);
}
Bar.prototype.setPos = function(pos, force) {
if (pos < 0) pos = 0;
if (pos > this.total - this.screen) pos = this.total - this.screen;
if (!force && pos == this.pos) return false;
this.pos = pos;
this.inner.style[this.orientation == "horizontal" ? "left" : "top"] =
(pos * (this.size / this.total)) + "px";
return true
};
Bar.prototype.moveTo = function(pos) {
if (this.setPos(pos)) this.scroll(pos, this.orientation);
}
var minButtonSize = 10;
Bar.prototype.update = function(scrollSize, clientSize, barSize) {
var sizeChanged = this.screen != clientSize || this.total != scrollSize || this.size != barSize
if (sizeChanged) {
this.screen = clientSize;
this.total = scrollSize;
this.size = barSize;
}
var buttonSize = this.screen * (this.size / this.total);
if (buttonSize < minButtonSize) {
this.size -= minButtonSize - buttonSize;
buttonSize = minButtonSize;
}
this.inner.style[this.orientation == "horizontal" ? "width" : "height"] =
buttonSize + "px";
this.setPos(this.pos, sizeChanged);
};
function SimpleScrollbars(cls, place, scroll) {
this.addClass = cls;
this.horiz = new Bar(cls, "horizontal", scroll);
place(this.horiz.node);
this.vert = new Bar(cls, "vertical", scroll);
place(this.vert.node);
this.width = null;
}
SimpleScrollbars.prototype.update = function(measure) {
if (this.width == null) {
var style = window.getComputedStyle ? window.getComputedStyle(this.horiz.node) : this.horiz.node.currentStyle;
if (style) this.width = parseInt(style.height);
}
var width = this.width || 0;
var needsH = measure.scrollWidth > measure.clientWidth + 1;
var needsV = measure.scrollHeight > measure.clientHeight + 1;
this.vert.node.style.display = needsV ? "block" : "none";
this.horiz.node.style.display = needsH ? "block" : "none";
if (needsV) {
this.vert.update(measure.scrollHeight, measure.clientHeight,
measure.viewHeight - (needsH ? width : 0));
this.vert.node.style.bottom = needsH ? width + "px" : "0";
}
if (needsH) {
this.horiz.update(measure.scrollWidth, measure.clientWidth,
measure.viewWidth - (needsV ? width : 0) - measure.barLeft);
this.horiz.node.style.right = needsV ? width + "px" : "0";
this.horiz.node.style.left = measure.barLeft + "px";
}
return {right: needsV ? width : 0, bottom: needsH ? width : 0};
};
SimpleScrollbars.prototype.setScrollTop = function(pos) {
this.vert.setPos(pos);
};
SimpleScrollbars.prototype.setScrollLeft = function(pos) {
this.horiz.setPos(pos);
};
SimpleScrollbars.prototype.clear = function() {
var parent = this.horiz.node.parentNode;
parent.removeChild(this.horiz.node);
parent.removeChild(this.vert.node);
};
CodeMirror.scrollbarModel.simple = function(place, scroll) {
return new SimpleScrollbars("CodeMirror-simplescroll", place, scroll);
};
CodeMirror.scrollbarModel.overlay = function(place, scroll) {
return new SimpleScrollbars("CodeMirror-overlayscroll", place, scroll);
};
});
-346
View File
@@ -1,346 +0,0 @@
/* BASICS */
.CodeMirror {
/* Set height, width, borders, and global font properties here */
font-family: monospace;
height: 300px;
color: black;
direction: ltr;
}
/* PADDING */
.CodeMirror-lines {
padding: 4px 0; /* Vertical padding around content */
}
.CodeMirror pre {
padding: 0 4px; /* Horizontal padding of content */
}
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
background-color: white; /* The little square between H and V scrollbars */
}
/* GUTTER */
.CodeMirror-gutters {
border-right: 1px solid #ddd;
background-color: #f7f7f7;
white-space: nowrap;
}
.CodeMirror-linenumbers {}
.CodeMirror-linenumber {
padding: 0 3px 0 5px;
min-width: 20px;
text-align: right;
color: #999;
white-space: nowrap;
}
.CodeMirror-guttermarker { color: black; }
.CodeMirror-guttermarker-subtle { color: #999; }
/* CURSOR */
.CodeMirror-cursor {
border-left: 1px solid black;
border-right: none;
width: 0;
}
/* Shown when moving in bi-directional text */
.CodeMirror div.CodeMirror-secondarycursor {
border-left: 1px solid silver;
}
.cm-fat-cursor .CodeMirror-cursor {
width: auto;
border: 0 !important;
background: #7e7;
}
.cm-fat-cursor div.CodeMirror-cursors {
z-index: 1;
}
.cm-fat-cursor-mark {
background-color: rgba(20, 255, 20, 0.5);
-webkit-animation: blink 1.06s steps(1) infinite;
-moz-animation: blink 1.06s steps(1) infinite;
animation: blink 1.06s steps(1) infinite;
}
.cm-animate-fat-cursor {
width: auto;
border: 0;
-webkit-animation: blink 1.06s steps(1) infinite;
-moz-animation: blink 1.06s steps(1) infinite;
animation: blink 1.06s steps(1) infinite;
background-color: #7e7;
}
@-moz-keyframes blink {
0% {}
50% { background-color: transparent; }
100% {}
}
@-webkit-keyframes blink {
0% {}
50% { background-color: transparent; }
100% {}
}
@keyframes blink {
0% {}
50% { background-color: transparent; }
100% {}
}
/* Can style cursor different in overwrite (non-insert) mode */
.CodeMirror-overwrite .CodeMirror-cursor {}
.cm-tab { display: inline-block; text-decoration: inherit; }
.CodeMirror-rulers {
position: absolute;
left: 0; right: 0; top: -50px; bottom: -20px;
overflow: hidden;
}
.CodeMirror-ruler {
border-left: 1px solid #ccc;
top: 0; bottom: 0;
position: absolute;
}
/* DEFAULT THEME */
.cm-s-default .cm-header {color: blue;}
.cm-s-default .cm-quote {color: #090;}
.cm-negative {color: #d44;}
.cm-positive {color: #292;}
.cm-header, .cm-strong {font-weight: bold;}
.cm-em {font-style: italic;}
.cm-link {text-decoration: underline;}
.cm-strikethrough {text-decoration: line-through;}
.cm-s-default .cm-keyword {color: #708;}
.cm-s-default .cm-atom {color: #219;}
.cm-s-default .cm-number {color: #164;}
.cm-s-default .cm-def {color: #00f;}
.cm-s-default .cm-variable,
.cm-s-default .cm-punctuation,
.cm-s-default .cm-property,
.cm-s-default .cm-operator {}
.cm-s-default .cm-variable-2 {color: #05a;}
.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}
.cm-s-default .cm-comment {color: #a50;}
.cm-s-default .cm-string {color: #a11;}
.cm-s-default .cm-string-2 {color: #f50;}
.cm-s-default .cm-meta {color: #555;}
.cm-s-default .cm-qualifier {color: #555;}
.cm-s-default .cm-builtin {color: #30a;}
.cm-s-default .cm-bracket {color: #997;}
.cm-s-default .cm-tag {color: #170;}
.cm-s-default .cm-attribute {color: #00c;}
.cm-s-default .cm-hr {color: #999;}
.cm-s-default .cm-link {color: #00c;}
.cm-s-default .cm-error {color: #f00;}
.cm-invalidchar {color: #f00;}
.CodeMirror-composing { border-bottom: 2px solid; }
/* Default styles for common addons */
div.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
.CodeMirror-activeline-background {background: #e8f2ff;}
/* STOP */
/* The rest of this file contains styles related to the mechanics of
the editor. You probably shouldn't touch them. */
.CodeMirror {
position: relative;
overflow: hidden;
background: white;
}
.CodeMirror-scroll {
overflow: scroll !important; /* Things will break if this is overridden */
/* 30px is the magic margin used to hide the element's real scrollbars */
/* See overflow: hidden in .CodeMirror */
margin-bottom: -30px; margin-right: -30px;
padding-bottom: 30px;
height: 100%;
outline: none; /* Prevent dragging from highlighting the element */
position: relative;
}
.CodeMirror-sizer {
position: relative;
border-right: 30px solid transparent;
}
/* The fake, visible scrollbars. Used to force redraw during scrolling
before actual scrolling happens, thus preventing shaking and
flickering artifacts. */
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
position: absolute;
z-index: 6;
display: none;
}
.CodeMirror-vscrollbar {
right: 0; top: 0;
overflow-x: hidden;
overflow-y: scroll;
}
.CodeMirror-hscrollbar {
bottom: 0; left: 0;
overflow-y: hidden;
overflow-x: scroll;
}
.CodeMirror-scrollbar-filler {
right: 0; bottom: 0;
}
.CodeMirror-gutter-filler {
left: 0; bottom: 0;
}
.CodeMirror-gutters {
position: absolute; left: 0; top: 0;
min-height: 100%;
z-index: 3;
}
.CodeMirror-gutter {
white-space: normal;
height: 100%;
display: inline-block;
vertical-align: top;
margin-bottom: -30px;
}
.CodeMirror-gutter-wrapper {
position: absolute;
z-index: 4;
background: none !important;
border: none !important;
}
.CodeMirror-gutter-background {
position: absolute;
top: 0; bottom: 0;
z-index: 4;
}
.CodeMirror-gutter-elt {
position: absolute;
cursor: default;
z-index: 4;
}
.CodeMirror-gutter-wrapper ::selection { background-color: transparent }
.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }
.CodeMirror-lines {
cursor: text;
min-height: 1px; /* prevents collapsing before first draw */
}
.CodeMirror pre {
/* Reset some styles that the rest of the page might have set */
-moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
border-width: 0;
background: transparent;
font-family: inherit;
font-size: inherit;
margin: 0;
white-space: pre;
word-wrap: normal;
line-height: inherit;
color: inherit;
z-index: 2;
position: relative;
overflow: visible;
-webkit-tap-highlight-color: transparent;
-webkit-font-variant-ligatures: contextual;
font-variant-ligatures: contextual;
}
.CodeMirror-wrap pre {
word-wrap: break-word;
white-space: pre-wrap;
word-break: normal;
}
.CodeMirror-linebackground {
position: absolute;
left: 0; right: 0; top: 0; bottom: 0;
z-index: 0;
}
.CodeMirror-linewidget {
position: relative;
z-index: 2;
padding: 0.1px; /* Force widget margins to stay inside of the container */
}
.CodeMirror-widget {}
.CodeMirror-rtl pre { direction: rtl; }
.CodeMirror-code {
outline: none;
}
/* Force content-box sizing for the elements where we expect it */
.CodeMirror-scroll,
.CodeMirror-sizer,
.CodeMirror-gutter,
.CodeMirror-gutters,
.CodeMirror-linenumber {
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.CodeMirror-measure {
position: absolute;
width: 100%;
height: 0;
overflow: hidden;
visibility: hidden;
}
.CodeMirror-cursor {
position: absolute;
pointer-events: none;
}
.CodeMirror-measure pre { position: static; }
div.CodeMirror-cursors {
visibility: hidden;
position: relative;
z-index: 3;
}
div.CodeMirror-dragcursors {
visibility: visible;
}
.CodeMirror-focused div.CodeMirror-cursors {
visibility: visible;
}
.CodeMirror-selected { background: #d9d9d9; }
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
.CodeMirror-crosshair { cursor: crosshair; }
.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }
.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }
.cm-searching {
background-color: #ffa;
background-color: rgba(255, 255, 0, .4);
}
/* Used to force a border model for a node */
.cm-force-border { padding-right: .1px; }
@media print {
/* Hide the cursor when printing */
.CodeMirror div.CodeMirror-cursors {
visibility: hidden;
}
}
/* See issue #2901 */
.cm-tab-wrap-hack:after { content: ''; }
/* Help users use markselection to safely style text background */
span.CodeMirror-selectedtext { background: none; }
-9725
View File
File diff suppressed because it is too large Load Diff
-831
View File
@@ -1,831 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
CodeMirror.defineMode("css", function(config, parserConfig) {
var inline = parserConfig.inline
if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode("text/css");
var indentUnit = config.indentUnit,
tokenHooks = parserConfig.tokenHooks,
documentTypes = parserConfig.documentTypes || {},
mediaTypes = parserConfig.mediaTypes || {},
mediaFeatures = parserConfig.mediaFeatures || {},
mediaValueKeywords = parserConfig.mediaValueKeywords || {},
propertyKeywords = parserConfig.propertyKeywords || {},
nonStandardPropertyKeywords = parserConfig.nonStandardPropertyKeywords || {},
fontProperties = parserConfig.fontProperties || {},
counterDescriptors = parserConfig.counterDescriptors || {},
colorKeywords = parserConfig.colorKeywords || {},
valueKeywords = parserConfig.valueKeywords || {},
allowNested = parserConfig.allowNested,
lineComment = parserConfig.lineComment,
supportsAtComponent = parserConfig.supportsAtComponent === true;
var type, override;
function ret(style, tp) { type = tp; return style; }
// Tokenizers
function tokenBase(stream, state) {
var ch = stream.next();
if (tokenHooks[ch]) {
var result = tokenHooks[ch](stream, state);
if (result !== false) return result;
}
if (ch == "@") {
stream.eatWhile(/[\w\\\-]/);
return ret("def", stream.current());
} else if (ch == "=" || (ch == "~" || ch == "|") && stream.eat("=")) {
return ret(null, "compare");
} else if (ch == "\"" || ch == "'") {
state.tokenize = tokenString(ch);
return state.tokenize(stream, state);
} else if (ch == "#") {
stream.eatWhile(/[\w\\\-]/);
return ret("atom", "hash");
} else if (ch == "!") {
stream.match(/^\s*\w*/);
return ret("keyword", "important");
} else if (/\d/.test(ch) || ch == "." && stream.eat(/\d/)) {
stream.eatWhile(/[\w.%]/);
return ret("number", "unit");
} else if (ch === "-") {
if (/[\d.]/.test(stream.peek())) {
stream.eatWhile(/[\w.%]/);
return ret("number", "unit");
} else if (stream.match(/^-[\w\\\-]*/)) {
stream.eatWhile(/[\w\\\-]/);
if (stream.match(/^\s*:/, false))
return ret("variable-2", "variable-definition");
return ret("variable-2", "variable");
} else if (stream.match(/^\w+-/)) {
return ret("meta", "meta");
}
} else if (/[,+>*\/]/.test(ch)) {
return ret(null, "select-op");
} else if (ch == "." && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) {
return ret("qualifier", "qualifier");
} else if (/[:;{}\[\]\(\)]/.test(ch)) {
return ret(null, ch);
} else if (stream.match(/[\w-.]+(?=\()/)) {
if (/^(url(-prefix)?|domain|regexp)$/.test(stream.current().toLowerCase())) {
state.tokenize = tokenParenthesized;
}
return ret("variable callee", "variable");
} else if (/[\w\\\-]/.test(ch)) {
stream.eatWhile(/[\w\\\-]/);
return ret("property", "word");
} else {
return ret(null, null);
}
}
function tokenString(quote) {
return function(stream, state) {
var escaped = false, ch;
while ((ch = stream.next()) != null) {
if (ch == quote && !escaped) {
if (quote == ")") stream.backUp(1);
break;
}
escaped = !escaped && ch == "\\";
}
if (ch == quote || !escaped && quote != ")") state.tokenize = null;
return ret("string", "string");
};
}
function tokenParenthesized(stream, state) {
stream.next(); // Must be '('
if (!stream.match(/\s*[\"\')]/, false))
state.tokenize = tokenString(")");
else
state.tokenize = null;
return ret(null, "(");
}
// Context management
function Context(type, indent, prev) {
this.type = type;
this.indent = indent;
this.prev = prev;
}
function pushContext(state, stream, type, indent) {
state.context = new Context(type, stream.indentation() + (indent === false ? 0 : indentUnit), state.context);
return type;
}
function popContext(state) {
if (state.context.prev)
state.context = state.context.prev;
return state.context.type;
}
function pass(type, stream, state) {
return states[state.context.type](type, stream, state);
}
function popAndPass(type, stream, state, n) {
for (var i = n || 1; i > 0; i--)
state.context = state.context.prev;
return pass(type, stream, state);
}
// Parser
function wordAsValue(stream) {
var word = stream.current().toLowerCase();
if (valueKeywords.hasOwnProperty(word))
override = "atom";
else if (colorKeywords.hasOwnProperty(word))
override = "keyword";
else
override = "variable";
}
var states = {};
states.top = function(type, stream, state) {
if (type == "{") {
return pushContext(state, stream, "block");
} else if (type == "}" && state.context.prev) {
return popContext(state);
} else if (supportsAtComponent && /@component/i.test(type)) {
return pushContext(state, stream, "atComponentBlock");
} else if (/^@(-moz-)?document$/i.test(type)) {
return pushContext(state, stream, "documentTypes");
} else if (/^@(media|supports|(-moz-)?document|import)$/i.test(type)) {
return pushContext(state, stream, "atBlock");
} else if (/^@(font-face|counter-style)/i.test(type)) {
state.stateArg = type;
return "restricted_atBlock_before";
} else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(type)) {
return "keyframes";
} else if (type && type.charAt(0) == "@") {
return pushContext(state, stream, "at");
} else if (type == "hash") {
override = "builtin";
} else if (type == "word") {
override = "tag";
} else if (type == "variable-definition") {
return "maybeprop";
} else if (type == "interpolation") {
return pushContext(state, stream, "interpolation");
} else if (type == ":") {
return "pseudo";
} else if (allowNested && type == "(") {
return pushContext(state, stream, "parens");
}
return state.context.type;
};
states.block = function(type, stream, state) {
if (type == "word") {
var word = stream.current().toLowerCase();
if (propertyKeywords.hasOwnProperty(word)) {
override = "property";
return "maybeprop";
} else if (nonStandardPropertyKeywords.hasOwnProperty(word)) {
override = "string-2";
return "maybeprop";
} else if (allowNested) {
override = stream.match(/^\s*:(?:\s|$)/, false) ? "property" : "tag";
return "block";
} else {
override += " error";
return "maybeprop";
}
} else if (type == "meta") {
return "block";
} else if (!allowNested && (type == "hash" || type == "qualifier")) {
override = "error";
return "block";
} else {
return states.top(type, stream, state);
}
};
states.maybeprop = function(type, stream, state) {
if (type == ":") return pushContext(state, stream, "prop");
return pass(type, stream, state);
};
states.prop = function(type, stream, state) {
if (type == ";") return popContext(state);
if (type == "{" && allowNested) return pushContext(state, stream, "propBlock");
if (type == "}" || type == "{") return popAndPass(type, stream, state);
if (type == "(") return pushContext(state, stream, "parens");
if (type == "hash" && !/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(stream.current())) {
override += " error";
} else if (type == "word") {
wordAsValue(stream);
} else if (type == "interpolation") {
return pushContext(state, stream, "interpolation");
}
return "prop";
};
states.propBlock = function(type, _stream, state) {
if (type == "}") return popContext(state);
if (type == "word") { override = "property"; return "maybeprop"; }
return state.context.type;
};
states.parens = function(type, stream, state) {
if (type == "{" || type == "}") return popAndPass(type, stream, state);
if (type == ")") return popContext(state);
if (type == "(") return pushContext(state, stream, "parens");
if (type == "interpolation") return pushContext(state, stream, "interpolation");
if (type == "word") wordAsValue(stream);
return "parens";
};
states.pseudo = function(type, stream, state) {
if (type == "meta") return "pseudo";
if (type == "word") {
override = "variable-3";
return state.context.type;
}
return pass(type, stream, state);
};
states.documentTypes = function(type, stream, state) {
if (type == "word" && documentTypes.hasOwnProperty(stream.current())) {
override = "tag";
return state.context.type;
} else {
return states.atBlock(type, stream, state);
}
};
states.atBlock = function(type, stream, state) {
if (type == "(") return pushContext(state, stream, "atBlock_parens");
if (type == "}" || type == ";") return popAndPass(type, stream, state);
if (type == "{") return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top");
if (type == "interpolation") return pushContext(state, stream, "interpolation");
if (type == "word") {
var word = stream.current().toLowerCase();
if (word == "only" || word == "not" || word == "and" || word == "or")
override = "keyword";
else if (mediaTypes.hasOwnProperty(word))
override = "attribute";
else if (mediaFeatures.hasOwnProperty(word))
override = "property";
else if (mediaValueKeywords.hasOwnProperty(word))
override = "keyword";
else if (propertyKeywords.hasOwnProperty(word))
override = "property";
else if (nonStandardPropertyKeywords.hasOwnProperty(word))
override = "string-2";
else if (valueKeywords.hasOwnProperty(word))
override = "atom";
else if (colorKeywords.hasOwnProperty(word))
override = "keyword";
else
override = "error";
}
return state.context.type;
};
states.atComponentBlock = function(type, stream, state) {
if (type == "}")
return popAndPass(type, stream, state);
if (type == "{")
return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top", false);
if (type == "word")
override = "error";
return state.context.type;
};
states.atBlock_parens = function(type, stream, state) {
if (type == ")") return popContext(state);
if (type == "{" || type == "}") return popAndPass(type, stream, state, 2);
return states.atBlock(type, stream, state);
};
states.restricted_atBlock_before = function(type, stream, state) {
if (type == "{")
return pushContext(state, stream, "restricted_atBlock");
if (type == "word" && state.stateArg == "@counter-style") {
override = "variable";
return "restricted_atBlock_before";
}
return pass(type, stream, state);
};
states.restricted_atBlock = function(type, stream, state) {
if (type == "}") {
state.stateArg = null;
return popContext(state);
}
if (type == "word") {
if ((state.stateArg == "@font-face" && !fontProperties.hasOwnProperty(stream.current().toLowerCase())) ||
(state.stateArg == "@counter-style" && !counterDescriptors.hasOwnProperty(stream.current().toLowerCase())))
override = "error";
else
override = "property";
return "maybeprop";
}
return "restricted_atBlock";
};
states.keyframes = function(type, stream, state) {
if (type == "word") { override = "variable"; return "keyframes"; }
if (type == "{") return pushContext(state, stream, "top");
return pass(type, stream, state);
};
states.at = function(type, stream, state) {
if (type == ";") return popContext(state);
if (type == "{" || type == "}") return popAndPass(type, stream, state);
if (type == "word") override = "tag";
else if (type == "hash") override = "builtin";
return "at";
};
states.interpolation = function(type, stream, state) {
if (type == "}") return popContext(state);
if (type == "{" || type == ";") return popAndPass(type, stream, state);
if (type == "word") override = "variable";
else if (type != "variable" && type != "(" && type != ")") override = "error";
return "interpolation";
};
return {
startState: function(base) {
return {tokenize: null,
state: inline ? "block" : "top",
stateArg: null,
context: new Context(inline ? "block" : "top", base || 0, null)};
},
token: function(stream, state) {
if (!state.tokenize && stream.eatSpace()) return null;
var style = (state.tokenize || tokenBase)(stream, state);
if (style && typeof style == "object") {
type = style[1];
style = style[0];
}
override = style;
if (type != "comment")
state.state = states[state.state](type, stream, state);
return override;
},
indent: function(state, textAfter) {
var cx = state.context, ch = textAfter && textAfter.charAt(0);
var indent = cx.indent;
if (cx.type == "prop" && (ch == "}" || ch == ")")) cx = cx.prev;
if (cx.prev) {
if (ch == "}" && (cx.type == "block" || cx.type == "top" ||
cx.type == "interpolation" || cx.type == "restricted_atBlock")) {
// Resume indentation from parent context.
cx = cx.prev;
indent = cx.indent;
} else if (ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") ||
ch == "{" && (cx.type == "at" || cx.type == "atBlock")) {
// Dedent relative to current context.
indent = Math.max(0, cx.indent - indentUnit);
}
}
return indent;
},
electricChars: "}",
blockCommentStart: "/*",
blockCommentEnd: "*/",
blockCommentContinue: " * ",
lineComment: lineComment,
fold: "brace"
};
});
function keySet(array) {
var keys = {};
for (var i = 0; i < array.length; ++i) {
keys[array[i].toLowerCase()] = true;
}
return keys;
}
var documentTypes_ = [
"domain", "regexp", "url", "url-prefix"
], documentTypes = keySet(documentTypes_);
var mediaTypes_ = [
"all", "aural", "braille", "handheld", "print", "projection", "screen",
"tty", "tv", "embossed"
], mediaTypes = keySet(mediaTypes_);
var mediaFeatures_ = [
"width", "min-width", "max-width", "height", "min-height", "max-height",
"device-width", "min-device-width", "max-device-width", "device-height",
"min-device-height", "max-device-height", "aspect-ratio",
"min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio",
"min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color",
"max-color", "color-index", "min-color-index", "max-color-index",
"monochrome", "min-monochrome", "max-monochrome", "resolution",
"min-resolution", "max-resolution", "scan", "grid", "orientation",
"device-pixel-ratio", "min-device-pixel-ratio", "max-device-pixel-ratio",
"pointer", "any-pointer", "hover", "any-hover"
], mediaFeatures = keySet(mediaFeatures_);
var mediaValueKeywords_ = [
"landscape", "portrait", "none", "coarse", "fine", "on-demand", "hover",
"interlace", "progressive"
], mediaValueKeywords = keySet(mediaValueKeywords_);
var propertyKeywords_ = [
"align-content", "align-items", "align-self", "alignment-adjust",
"alignment-baseline", "anchor-point", "animation", "animation-delay",
"animation-direction", "animation-duration", "animation-fill-mode",
"animation-iteration-count", "animation-name", "animation-play-state",
"animation-timing-function", "appearance", "azimuth", "backface-visibility",
"background", "background-attachment", "background-blend-mode", "background-clip",
"background-color", "background-image", "background-origin", "background-position",
"background-repeat", "background-size", "baseline-shift", "binding",
"bleed", "bookmark-label", "bookmark-level", "bookmark-state",
"bookmark-target", "border", "border-bottom", "border-bottom-color",
"border-bottom-left-radius", "border-bottom-right-radius",
"border-bottom-style", "border-bottom-width", "border-collapse",
"border-color", "border-image", "border-image-outset",
"border-image-repeat", "border-image-slice", "border-image-source",
"border-image-width", "border-left", "border-left-color",
"border-left-style", "border-left-width", "border-radius", "border-right",
"border-right-color", "border-right-style", "border-right-width",
"border-spacing", "border-style", "border-top", "border-top-color",
"border-top-left-radius", "border-top-right-radius", "border-top-style",
"border-top-width", "border-width", "bottom", "box-decoration-break",
"box-shadow", "box-sizing", "break-after", "break-before", "break-inside",
"caption-side", "caret-color", "clear", "clip", "color", "color-profile", "column-count",
"column-fill", "column-gap", "column-rule", "column-rule-color",
"column-rule-style", "column-rule-width", "column-span", "column-width",
"columns", "content", "counter-increment", "counter-reset", "crop", "cue",
"cue-after", "cue-before", "cursor", "direction", "display",
"dominant-baseline", "drop-initial-after-adjust",
"drop-initial-after-align", "drop-initial-before-adjust",
"drop-initial-before-align", "drop-initial-size", "drop-initial-value",
"elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis",
"flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap",
"float", "float-offset", "flow-from", "flow-into", "font", "font-feature-settings",
"font-family", "font-kerning", "font-language-override", "font-size", "font-size-adjust",
"font-stretch", "font-style", "font-synthesis", "font-variant",
"font-variant-alternates", "font-variant-caps", "font-variant-east-asian",
"font-variant-ligatures", "font-variant-numeric", "font-variant-position",
"font-weight", "grid", "grid-area", "grid-auto-columns", "grid-auto-flow",
"grid-auto-rows", "grid-column", "grid-column-end", "grid-column-gap",
"grid-column-start", "grid-gap", "grid-row", "grid-row-end", "grid-row-gap",
"grid-row-start", "grid-template", "grid-template-areas", "grid-template-columns",
"grid-template-rows", "hanging-punctuation", "height", "hyphens",
"icon", "image-orientation", "image-rendering", "image-resolution",
"inline-box-align", "justify-content", "justify-items", "justify-self", "left", "letter-spacing",
"line-break", "line-height", "line-stacking", "line-stacking-ruby",
"line-stacking-shift", "line-stacking-strategy", "list-style",
"list-style-image", "list-style-position", "list-style-type", "margin",
"margin-bottom", "margin-left", "margin-right", "margin-top",
"marks", "marquee-direction", "marquee-loop",
"marquee-play-count", "marquee-speed", "marquee-style", "max-height",
"max-width", "min-height", "min-width", "mix-blend-mode", "move-to", "nav-down", "nav-index",
"nav-left", "nav-right", "nav-up", "object-fit", "object-position",
"opacity", "order", "orphans", "outline",
"outline-color", "outline-offset", "outline-style", "outline-width",
"overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y",
"padding", "padding-bottom", "padding-left", "padding-right", "padding-top",
"page", "page-break-after", "page-break-before", "page-break-inside",
"page-policy", "pause", "pause-after", "pause-before", "perspective",
"perspective-origin", "pitch", "pitch-range", "place-content", "place-items", "place-self", "play-during", "position",
"presentation-level", "punctuation-trim", "quotes", "region-break-after",
"region-break-before", "region-break-inside", "region-fragment",
"rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness",
"right", "rotation", "rotation-point", "ruby-align", "ruby-overhang",
"ruby-position", "ruby-span", "shape-image-threshold", "shape-inside", "shape-margin",
"shape-outside", "size", "speak", "speak-as", "speak-header",
"speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set",
"tab-size", "table-layout", "target", "target-name", "target-new",
"target-position", "text-align", "text-align-last", "text-decoration",
"text-decoration-color", "text-decoration-line", "text-decoration-skip",
"text-decoration-style", "text-emphasis", "text-emphasis-color",
"text-emphasis-position", "text-emphasis-style", "text-height",
"text-indent", "text-justify", "text-outline", "text-overflow", "text-shadow",
"text-size-adjust", "text-space-collapse", "text-transform", "text-underline-position",
"text-wrap", "top", "transform", "transform-origin", "transform-style",
"transition", "transition-delay", "transition-duration",
"transition-property", "transition-timing-function", "unicode-bidi",
"user-select", "vertical-align", "visibility", "voice-balance", "voice-duration",
"voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress",
"voice-volume", "volume", "white-space", "widows", "width", "will-change", "word-break",
"word-spacing", "word-wrap", "z-index",
// SVG-specific
"clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color",
"flood-opacity", "lighting-color", "stop-color", "stop-opacity", "pointer-events",
"color-interpolation", "color-interpolation-filters",
"color-rendering", "fill", "fill-opacity", "fill-rule", "image-rendering",
"marker", "marker-end", "marker-mid", "marker-start", "shape-rendering", "stroke",
"stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin",
"stroke-miterlimit", "stroke-opacity", "stroke-width", "text-rendering",
"baseline-shift", "dominant-baseline", "glyph-orientation-horizontal",
"glyph-orientation-vertical", "text-anchor", "writing-mode"
], propertyKeywords = keySet(propertyKeywords_);
var nonStandardPropertyKeywords_ = [
"scrollbar-arrow-color", "scrollbar-base-color", "scrollbar-dark-shadow-color",
"scrollbar-face-color", "scrollbar-highlight-color", "scrollbar-shadow-color",
"scrollbar-3d-light-color", "scrollbar-track-color", "shape-inside",
"searchfield-cancel-button", "searchfield-decoration", "searchfield-results-button",
"searchfield-results-decoration", "zoom"
], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_);
var fontProperties_ = [
"font-family", "src", "unicode-range", "font-variant", "font-feature-settings",
"font-stretch", "font-weight", "font-style"
], fontProperties = keySet(fontProperties_);
var counterDescriptors_ = [
"additive-symbols", "fallback", "negative", "pad", "prefix", "range",
"speak-as", "suffix", "symbols", "system"
], counterDescriptors = keySet(counterDescriptors_);
var colorKeywords_ = [
"aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige",
"bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown",
"burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue",
"cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod",
"darkgray", "darkgreen", "darkkhaki", "darkmagenta", "darkolivegreen",
"darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen",
"darkslateblue", "darkslategray", "darkturquoise", "darkviolet",
"deeppink", "deepskyblue", "dimgray", "dodgerblue", "firebrick",
"floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite",
"gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew",
"hotpink", "indianred", "indigo", "ivory", "khaki", "lavender",
"lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral",
"lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightpink",
"lightsalmon", "lightseagreen", "lightskyblue", "lightslategray",
"lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta",
"maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple",
"mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise",
"mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin",
"navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered",
"orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred",
"papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue",
"purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown",
"salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue",
"slateblue", "slategray", "snow", "springgreen", "steelblue", "tan",
"teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white",
"whitesmoke", "yellow", "yellowgreen"
], colorKeywords = keySet(colorKeywords_);
var valueKeywords_ = [
"above", "absolute", "activeborder", "additive", "activecaption", "afar",
"after-white-space", "ahead", "alias", "all", "all-scroll", "alphabetic", "alternate",
"always", "amharic", "amharic-abegede", "antialiased", "appworkspace",
"arabic-indic", "armenian", "asterisks", "attr", "auto", "auto-flow", "avoid", "avoid-column", "avoid-page",
"avoid-region", "background", "backwards", "baseline", "below", "bidi-override", "binary",
"bengali", "blink", "block", "block-axis", "bold", "bolder", "border", "border-box",
"both", "bottom", "break", "break-all", "break-word", "bullets", "button", "button-bevel",
"buttonface", "buttonhighlight", "buttonshadow", "buttontext", "calc", "cambodian",
"capitalize", "caps-lock-indicator", "caption", "captiontext", "caret",
"cell", "center", "checkbox", "circle", "cjk-decimal", "cjk-earthly-branch",
"cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",
"col-resize", "collapse", "color", "color-burn", "color-dodge", "column", "column-reverse",
"compact", "condensed", "contain", "content", "contents",
"content-box", "context-menu", "continuous", "copy", "counter", "counters", "cover", "crop",
"cross", "crosshair", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal",
"decimal-leading-zero", "default", "default-button", "dense", "destination-atop",
"destination-in", "destination-out", "destination-over", "devanagari", "difference",
"disc", "discard", "disclosure-closed", "disclosure-open", "document",
"dot-dash", "dot-dot-dash",
"dotted", "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",
"element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede",
"ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er",
"ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er",
"ethiopic-halehame-aa-et", "ethiopic-halehame-am-et",
"ethiopic-halehame-gez", "ethiopic-halehame-om-et",
"ethiopic-halehame-sid-et", "ethiopic-halehame-so-et",
"ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig",
"ethiopic-numeric", "ew-resize", "exclusion", "expanded", "extends", "extra-condensed",
"extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "flex", "flex-end", "flex-start", "footnotes",
"forwards", "from", "geometricPrecision", "georgian", "graytext", "grid", "groove",
"gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hard-light", "hebrew",
"help", "hidden", "hide", "higher", "highlight", "highlighttext",
"hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "hue", "icon", "ignore",
"inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite",
"infobackground", "infotext", "inherit", "initial", "inline", "inline-axis",
"inline-block", "inline-flex", "inline-grid", "inline-table", "inset", "inside", "intrinsic", "invert",
"italic", "japanese-formal", "japanese-informal", "justify", "kannada",
"katakana", "katakana-iroha", "keep-all", "khmer",
"korean-hangul-formal", "korean-hanja-formal", "korean-hanja-informal",
"landscape", "lao", "large", "larger", "left", "level", "lighter", "lighten",
"line-through", "linear", "linear-gradient", "lines", "list-item", "listbox", "listitem",
"local", "logical", "loud", "lower", "lower-alpha", "lower-armenian",
"lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian",
"lower-roman", "lowercase", "ltr", "luminosity", "malayalam", "match", "matrix", "matrix3d",
"media-controls-background", "media-current-time-display",
"media-fullscreen-button", "media-mute-button", "media-play-button",
"media-return-to-realtime-button", "media-rewind-button",
"media-seek-back-button", "media-seek-forward-button", "media-slider",
"media-sliderthumb", "media-time-remaining-display", "media-volume-slider",
"media-volume-slider-container", "media-volume-sliderthumb", "medium",
"menu", "menulist", "menulist-button", "menulist-text",
"menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic",
"mix", "mongolian", "monospace", "move", "multiple", "multiply", "myanmar", "n-resize",
"narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop",
"no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap",
"ns-resize", "numbers", "numeric", "nw-resize", "nwse-resize", "oblique", "octal", "opacity", "open-quote",
"optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset",
"outside", "outside-shape", "overlay", "overline", "padding", "padding-box",
"painted", "page", "paused", "persian", "perspective", "plus-darker", "plus-lighter",
"pointer", "polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d",
"progress", "push-button", "radial-gradient", "radio", "read-only",
"read-write", "read-write-plaintext-only", "rectangle", "region",
"relative", "repeat", "repeating-linear-gradient",
"repeating-radial-gradient", "repeat-x", "repeat-y", "reset", "reverse",
"rgb", "rgba", "ridge", "right", "rotate", "rotate3d", "rotateX", "rotateY",
"rotateZ", "round", "row", "row-resize", "row-reverse", "rtl", "run-in", "running",
"s-resize", "sans-serif", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen",
"scroll", "scrollbar", "scroll-position", "se-resize", "searchfield",
"searchfield-cancel-button", "searchfield-decoration",
"searchfield-results-button", "searchfield-results-decoration", "self-start", "self-end",
"semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama",
"simp-chinese-formal", "simp-chinese-informal", "single",
"skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal",
"slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
"small", "small-caps", "small-caption", "smaller", "soft-light", "solid", "somali",
"source-atop", "source-in", "source-out", "source-over", "space", "space-around", "space-between", "space-evenly", "spell-out", "square",
"square-button", "start", "static", "status-bar", "stretch", "stroke", "sub",
"subpixel-antialiased", "super", "sw-resize", "symbolic", "symbols", "system-ui", "table",
"table-caption", "table-cell", "table-column", "table-column-group",
"table-footer-group", "table-header-group", "table-row", "table-row-group",
"tamil",
"telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai",
"thick", "thin", "threeddarkshadow", "threedface", "threedhighlight",
"threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er",
"tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top",
"trad-chinese-formal", "trad-chinese-informal", "transform",
"translate", "translate3d", "translateX", "translateY", "translateZ",
"transparent", "ultra-condensed", "ultra-expanded", "underline", "unset", "up",
"upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal",
"upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url",
"var", "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted",
"visibleStroke", "visual", "w-resize", "wait", "wave", "wider",
"window", "windowframe", "windowtext", "words", "wrap", "wrap-reverse", "x-large", "x-small", "xor",
"xx-large", "xx-small"
], valueKeywords = keySet(valueKeywords_);
var allWords = documentTypes_.concat(mediaTypes_).concat(mediaFeatures_).concat(mediaValueKeywords_)
.concat(propertyKeywords_).concat(nonStandardPropertyKeywords_).concat(colorKeywords_)
.concat(valueKeywords_);
CodeMirror.registerHelper("hintWords", "css", allWords);
function tokenCComment(stream, state) {
var maybeEnd = false, ch;
while ((ch = stream.next()) != null) {
if (maybeEnd && ch == "/") {
state.tokenize = null;
break;
}
maybeEnd = (ch == "*");
}
return ["comment", "comment"];
}
CodeMirror.defineMIME("text/css", {
documentTypes: documentTypes,
mediaTypes: mediaTypes,
mediaFeatures: mediaFeatures,
mediaValueKeywords: mediaValueKeywords,
propertyKeywords: propertyKeywords,
nonStandardPropertyKeywords: nonStandardPropertyKeywords,
fontProperties: fontProperties,
counterDescriptors: counterDescriptors,
colorKeywords: colorKeywords,
valueKeywords: valueKeywords,
tokenHooks: {
"/": function(stream, state) {
if (!stream.eat("*")) return false;
state.tokenize = tokenCComment;
return tokenCComment(stream, state);
}
},
name: "css"
});
CodeMirror.defineMIME("text/x-scss", {
mediaTypes: mediaTypes,
mediaFeatures: mediaFeatures,
mediaValueKeywords: mediaValueKeywords,
propertyKeywords: propertyKeywords,
nonStandardPropertyKeywords: nonStandardPropertyKeywords,
colorKeywords: colorKeywords,
valueKeywords: valueKeywords,
fontProperties: fontProperties,
allowNested: true,
lineComment: "//",
tokenHooks: {
"/": function(stream, state) {
if (stream.eat("/")) {
stream.skipToEnd();
return ["comment", "comment"];
} else if (stream.eat("*")) {
state.tokenize = tokenCComment;
return tokenCComment(stream, state);
} else {
return ["operator", "operator"];
}
},
":": function(stream) {
if (stream.match(/\s*\{/, false))
return [null, null]
return false;
},
"$": function(stream) {
stream.match(/^[\w-]+/);
if (stream.match(/^\s*:/, false))
return ["variable-2", "variable-definition"];
return ["variable-2", "variable"];
},
"#": function(stream) {
if (!stream.eat("{")) return false;
return [null, "interpolation"];
}
},
name: "css",
helperType: "scss"
});
CodeMirror.defineMIME("text/x-less", {
mediaTypes: mediaTypes,
mediaFeatures: mediaFeatures,
mediaValueKeywords: mediaValueKeywords,
propertyKeywords: propertyKeywords,
nonStandardPropertyKeywords: nonStandardPropertyKeywords,
colorKeywords: colorKeywords,
valueKeywords: valueKeywords,
fontProperties: fontProperties,
allowNested: true,
lineComment: "//",
tokenHooks: {
"/": function(stream, state) {
if (stream.eat("/")) {
stream.skipToEnd();
return ["comment", "comment"];
} else if (stream.eat("*")) {
state.tokenize = tokenCComment;
return tokenCComment(stream, state);
} else {
return ["operator", "operator"];
}
},
"@": function(stream) {
if (stream.eat("{")) return [null, "interpolation"];
if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i, false)) return false;
stream.eatWhile(/[\w\\\-]/);
if (stream.match(/^\s*:/, false))
return ["variable-2", "variable-definition"];
return ["variable-2", "variable"];
},
"&": function() {
return ["atom", "atom"];
}
},
name: "css",
helperType: "less"
});
CodeMirror.defineMIME("text/x-gss", {
documentTypes: documentTypes,
mediaTypes: mediaTypes,
mediaFeatures: mediaFeatures,
propertyKeywords: propertyKeywords,
nonStandardPropertyKeywords: nonStandardPropertyKeywords,
fontProperties: fontProperties,
counterDescriptors: counterDescriptors,
colorKeywords: colorKeywords,
valueKeywords: valueKeywords,
supportsAtComponent: true,
tokenHooks: {
"/": function(stream, state) {
if (!stream.eat("*")) return false;
state.tokenize = tokenCComment;
return tokenCComment(stream, state);
}
},
name: "css",
helperType: "gss"
});
});
-104
View File
@@ -1,104 +0,0 @@
<!doctype html>
<title>CodeMirror: Closure Stylesheets (GSS) mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">
<link rel="stylesheet" href="../../lib/codemirror.css">
<link rel="stylesheet" href="../../addon/hint/show-hint.css">
<script src="../../lib/codemirror.js"></script>
<script src="css.js"></script>
<script src="../../addon/edit/matchbrackets.js"></script>
<script src="../../addon/hint/show-hint.js"></script>
<script src="../../addon/hint/css-hint.js"></script>
<style>.CodeMirror {background: #f8f8f8;}</style>
<div id=nav>
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
<ul>
<li><a href="../../index.html">Home</a>
<li><a href="../../doc/manual.html">Manual</a>
<li><a href="https://github.com/codemirror/codemirror">Code</a>
</ul>
<ul>
<li><a href="../index.html">Language modes</a>
<li><a class=active href="#">Closure Stylesheets (GSS)</a>
</ul>
</div>
<article>
<h2>Closure Stylesheets (GSS) mode</h2>
<form><textarea id="code" name="code">
/* Some example Closure Stylesheets */
@provide 'some.styles';
@require 'other.styles';
@component {
@def FONT_FAMILY "Times New Roman", Georgia, Serif;
@def FONT_SIZE_NORMAL 15px;
@def FONT_NORMAL normal FONT_SIZE_NORMAL FONT_FAMILY;
@def BG_COLOR rgb(235, 239, 249);
@def DIALOG_BORDER_COLOR rgb(107, 144, 218);
@def DIALOG_BG_COLOR BG_COLOR;
@def LEFT_HAND_NAV_WIDTH 180px;
@def LEFT_HAND_NAV_PADDING 3px;
@defmixin size(WIDTH, HEIGHT) {
width: WIDTH;
height: HEIGHT;
}
body {
background-color: BG_COLOR;
margin: 0;
padding: 3em 6em;
font: FONT_NORMAL;
color: #000;
}
#navigation a {
font-weight: bold;
text-decoration: none !important;
}
.dialog {
background-color: DIALOG_BG_COLOR;
border: 1px solid DIALOG_BORDER_COLOR;
}
.content {
position: absolute;
margin-left: add(LEFT_HAND_NAV_PADDING, /* padding left */
LEFT_HAND_NAV_WIDTH,
LEFT_HAND_NAV_PADDING); /* padding right */
}
.logo {
@mixin size(150px, 55px);
background-image: url('http://www.google.com/images/logo_sm.gif');
}
}
</textarea></form>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
extraKeys: {"Ctrl-Space": "autocomplete"},
lineNumbers: true,
matchBrackets: true,
mode: "text/x-gss"
});
</script>
<p>A mode for <a href="https://github.com/google/closure-stylesheets">Closure Stylesheets</a> (GSS).</p>
<p><strong>MIME type defined:</strong> <code>text/x-gss</code>.</p>
<p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#gss_*">normal</a>, <a href="../../test/index.html#verbose,gss_*">verbose</a>.</p>
</article>
-17
View File
@@ -1,17 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function() {
"use strict";
var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-gss");
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "gss"); }
MT("atComponent",
"[def @component] {",
"[tag foo] {",
" [property color]: [keyword black];",
"}",
"}");
})();
-75
View File
@@ -1,75 +0,0 @@
<!doctype html>
<title>CodeMirror: CSS mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">
<link rel="stylesheet" href="../../lib/codemirror.css">
<link rel="stylesheet" href="../../addon/hint/show-hint.css">
<script src="../../lib/codemirror.js"></script>
<script src="css.js"></script>
<script src="../../addon/hint/show-hint.js"></script>
<script src="../../addon/hint/css-hint.js"></script>
<style>.CodeMirror {background: #f8f8f8;}</style>
<div id=nav>
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
<ul>
<li><a href="../../index.html">Home</a>
<li><a href="../../doc/manual.html">Manual</a>
<li><a href="https://github.com/codemirror/codemirror">Code</a>
</ul>
<ul>
<li><a href="../index.html">Language modes</a>
<li><a class=active href="#">CSS</a>
</ul>
</div>
<article>
<h2>CSS mode</h2>
<form><textarea id="code" name="code">
/* Some example CSS */
@import url("something.css");
body {
margin: 0;
padding: 3em 6em;
font-family: tahoma, arial, sans-serif;
color: #000;
}
#navigation a {
font-weight: bold;
text-decoration: none !important;
}
h1 {
font-size: 2.5em;
}
h2 {
font-size: 1.7em;
}
h1:before, h2:before {
content: "::";
}
code {
font-family: courier, monospace;
font-size: 80%;
color: #418A8A;
}
</textarea></form>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
extraKeys: {"Ctrl-Space": "autocomplete"}
});
</script>
<p><strong>MIME types defined:</strong> <code>text/css</code>, <code>text/x-scss</code> (<a href="scss.html">demo</a>), <code>text/x-less</code> (<a href="less.html">demo</a>).</p>
<p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#css_*">normal</a>, <a href="../../test/index.html#verbose,css_*">verbose</a>.</p>
</article>
-152
View File
@@ -1,152 +0,0 @@
<!doctype html>
<title>CodeMirror: LESS mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">
<link rel="stylesheet" href="../../lib/codemirror.css">
<script src="../../lib/codemirror.js"></script>
<script src="../../addon/edit/matchbrackets.js"></script>
<script src="css.js"></script>
<style>.CodeMirror {border: 1px solid #ddd; line-height: 1.2;}</style>
<div id=nav>
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
<ul>
<li><a href="../../index.html">Home</a>
<li><a href="../../doc/manual.html">Manual</a>
<li><a href="https://github.com/codemirror/codemirror">Code</a>
</ul>
<ul>
<li><a href="../index.html">Language modes</a>
<li><a class=active href="#">LESS</a>
</ul>
</div>
<article>
<h2>LESS mode</h2>
<form><textarea id="code" name="code">@media screen and (device-aspect-ratio: 16/9) { … }
@media screen and (device-aspect-ratio: 1280/720) { … }
@media screen and (device-aspect-ratio: 2560/1440) { … }
html:lang(fr-be)
tr:nth-child(2n+1) /* represents every odd row of an HTML table */
img:nth-of-type(2n+1) { float: right; }
img:nth-of-type(2n) { float: left; }
body > h2:not(:first-of-type):not(:last-of-type)
html|*:not(:link):not(:visited)
*|*:not(:hover)
p::first-line { text-transform: uppercase }
@namespace foo url(http://www.example.com);
foo|h1 { color: blue } /* first rule */
span[hello="Ocean"][goodbye="Land"]
E[foo]{
padding:65px;
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
-webkit-appearance: none; // Inner-padding issues in Chrome OSX, Safari 5
}
button::-moz-focus-inner,
input::-moz-focus-inner { // Inner padding and border oddities in FF3/4
padding: 0;
border: 0;
}
.btn {
// reset here as of 2.0.3 due to Recess property order
border-color: #ccc;
border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);
}
fieldset span button, fieldset span input[type="file"] {
font-size:12px;
font-family:Arial, Helvetica, sans-serif;
}
.rounded-corners (@radius: 5px) {
border-radius: @radius;
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
}
@import url("something.css");
@light-blue: hsl(190, 50%, 65%);
#menu {
position: absolute;
width: 100%;
z-index: 3;
clear: both;
display: block;
background-color: @blue;
height: 42px;
border-top: 2px solid lighten(@alpha-blue, 20%);
border-bottom: 2px solid darken(@alpha-blue, 25%);
.box-shadow(0, 1px, 8px, 0.6);
-moz-box-shadow: 0 0 0 #000; // Because firefox sucks.
&.docked {
background-color: hsla(210, 60%, 40%, 0.4);
}
&:hover {
background-color: @blue;
}
#dropdown {
margin: 0 0 0 117px;
padding: 0;
padding-top: 5px;
display: none;
width: 190px;
border-top: 2px solid @medium;
color: @highlight;
border: 2px solid darken(@medium, 25%);
border-left-color: darken(@medium, 15%);
border-right-color: darken(@medium, 15%);
border-top-width: 0;
background-color: darken(@medium, 10%);
ul {
padding: 0px;
}
li {
font-size: 14px;
display: block;
text-align: left;
padding: 0;
border: 0;
a {
display: block;
padding: 0px 15px;
text-decoration: none;
color: white;
&:hover {
background-color: darken(@medium, 15%);
text-decoration: none;
}
}
}
.border-radius(5px, bottom);
.box-shadow(0, 6px, 8px, 0.5);
}
}
</textarea></form>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
matchBrackets: true,
mode: "text/x-less"
});
</script>
<p>The LESS mode is a sub-mode of the <a href="index.html">CSS mode</a> (defined in <code>css.js</code>).</p>
<p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#less_*">normal</a>, <a href="../../test/index.html#verbose,less_*">verbose</a>.</p>
</article>
-54
View File
@@ -1,54 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function() {
"use strict";
var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-less");
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "less"); }
MT("variable",
"[variable-2 @base]: [atom #f04615];",
"[qualifier .class] {",
" [property width]: [variable&callee percentage]([number 0.5]); [comment // returns `50%`]",
" [property color]: [variable&callee saturate]([variable-2 @base], [number 5%]);",
"}");
MT("amp",
"[qualifier .child], [qualifier .sibling] {",
" [qualifier .parent] [atom &] {",
" [property color]: [keyword black];",
" }",
" [atom &] + [atom &] {",
" [property color]: [keyword red];",
" }",
"}");
MT("mixin",
"[qualifier .mixin] ([variable dark]; [variable-2 @color]) {",
" [property color]: [variable&callee darken]([variable-2 @color], [number 10%]);",
"}",
"[qualifier .mixin] ([variable light]; [variable-2 @color]) {",
" [property color]: [variable&callee lighten]([variable-2 @color], [number 10%]);",
"}",
"[qualifier .mixin] ([variable-2 @_]; [variable-2 @color]) {",
" [property display]: [atom block];",
"}",
"[variable-2 @switch]: [variable light];",
"[qualifier .class] {",
" [qualifier .mixin]([variable-2 @switch]; [atom #888]);",
"}");
MT("nest",
"[qualifier .one] {",
" [def @media] ([property width]: [number 400px]) {",
" [property font-size]: [number 1.2em];",
" [def @media] [attribute print] [keyword and] [property color] {",
" [property color]: [keyword blue];",
" }",
" }",
"}");
MT("interpolation", ".@{[variable foo]} { [property font-weight]: [atom bold]; }");
})();
-158
View File
@@ -1,158 +0,0 @@
<!doctype html>
<title>CodeMirror: SCSS mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">
<link rel="stylesheet" href="../../lib/codemirror.css">
<script src="../../lib/codemirror.js"></script>
<script src="../../addon/edit/matchbrackets.js"></script>
<script src="css.js"></script>
<style>.CodeMirror {background: #f8f8f8;}</style>
<div id=nav>
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
<ul>
<li><a href="../../index.html">Home</a>
<li><a href="../../doc/manual.html">Manual</a>
<li><a href="https://github.com/codemirror/codemirror">Code</a>
</ul>
<ul>
<li><a href="../index.html">Language modes</a>
<li><a class=active href="#">SCSS</a>
</ul>
</div>
<article>
<h2>SCSS mode</h2>
<form><textarea id="code" name="code">
/* Some example SCSS */
@import "compass/css3";
$variable: #333;
$blue: #3bbfce;
$margin: 16px;
.content-navigation {
#nested {
background-color: black;
}
border-color: $blue;
color:
darken($blue, 9%);
}
.border {
padding: $margin / 2;
margin: $margin / 2;
border-color: $blue;
}
@mixin table-base {
th {
text-align: center;
font-weight: bold;
}
td, th {padding: 2px}
}
table.hl {
margin: 2em 0;
td.ln {
text-align: right;
}
}
li {
font: {
family: serif;
weight: bold;
size: 1.2em;
}
}
@mixin left($dist) {
float: left;
margin-left: $dist;
}
#data {
@include left(10px);
@include table-base;
}
.source {
@include flow-into(target);
border: 10px solid green;
margin: 20px;
width: 200px; }
.new-container {
@include flow-from(target);
border: 10px solid red;
margin: 20px;
width: 200px; }
body {
margin: 0;
padding: 3em 6em;
font-family: tahoma, arial, sans-serif;
color: #000;
}
@mixin yellow() {
background: yellow;
}
.big {
font-size: 14px;
}
.nested {
@include border-radius(3px);
@extend .big;
p {
background: whitesmoke;
a {
color: red;
}
}
}
#navigation a {
font-weight: bold;
text-decoration: none !important;
}
h1 {
font-size: 2.5em;
}
h2 {
font-size: 1.7em;
}
h1:before, h2:before {
content: "::";
}
code {
font-family: courier, monospace;
font-size: 80%;
color: #418A8A;
}
</textarea></form>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
matchBrackets: true,
mode: "text/x-scss"
});
</script>
<p>The SCSS mode is a sub-mode of the <a href="index.html">CSS mode</a> (defined in <code>css.js</code>).</p>
<p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#scss_*">normal</a>, <a href="../../test/index.html#verbose,scss_*">verbose</a>.</p>
</article>
-110
View File
@@ -1,110 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function() {
var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-scss");
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "scss"); }
MT('url_with_quotation',
"[tag foo] { [property background]:[variable&callee url]([string test.jpg]) }");
MT('url_with_double_quotes',
"[tag foo] { [property background]:[variable&callee url]([string \"test.jpg\"]) }");
MT('url_with_single_quotes',
"[tag foo] { [property background]:[variable&callee url]([string \'test.jpg\']) }");
MT('string',
"[def @import] [string \"compass/css3\"]");
MT('important_keyword',
"[tag foo] { [property background]:[variable&callee url]([string \'test.jpg\']) [keyword !important] }");
MT('variable',
"[variable-2 $blue]:[atom #333]");
MT('variable_as_attribute',
"[tag foo] { [property color]:[variable-2 $blue] }");
MT('numbers',
"[tag foo] { [property padding]:[number 10px] [number 10] [number 10em] [number 8in] }");
MT('number_percentage',
"[tag foo] { [property width]:[number 80%] }");
MT('selector',
"[builtin #hello][qualifier .world]{}");
MT('singleline_comment',
"[comment // this is a comment]");
MT('multiline_comment',
"[comment /*foobar*/]");
MT('attribute_with_hyphen',
"[tag foo] { [property font-size]:[number 10px] }");
MT('string_after_attribute',
"[tag foo] { [property content]:[string \"::\"] }");
MT('directives',
"[def @include] [qualifier .mixin]");
MT('basic_structure',
"[tag p] { [property background]:[keyword red]; }");
MT('nested_structure',
"[tag p] { [tag a] { [property color]:[keyword red]; } }");
MT('mixin',
"[def @mixin] [tag table-base] {}");
MT('number_without_semicolon',
"[tag p] {[property width]:[number 12]}",
"[tag a] {[property color]:[keyword red];}");
MT('atom_in_nested_block',
"[tag p] { [tag a] { [property color]:[atom #000]; } }");
MT('interpolation_in_property',
"[tag foo] { #{[variable-2 $hello]}:[number 2]; }");
MT('interpolation_in_selector',
"[tag foo]#{[variable-2 $hello]} { [property color]:[atom #000]; }");
MT('interpolation_error',
"[tag foo]#{[variable foo]} { [property color]:[atom #000]; }");
MT("divide_operator",
"[tag foo] { [property width]:[number 4] [operator /] [number 2] }");
MT('nested_structure_with_id_selector',
"[tag p] { [builtin #hello] { [property color]:[keyword red]; } }");
MT('indent_mixin',
"[def @mixin] [tag container] (",
" [variable-2 $a]: [number 10],",
" [variable-2 $b]: [number 10])",
"{}");
MT('indent_nested',
"[tag foo] {",
" [tag bar] {",
" }",
"}");
MT('indent_parentheses',
"[tag foo] {",
" [property color]: [variable&callee darken]([variable-2 $blue],",
" [number 9%]);",
"}");
MT('indent_vardef',
"[variable-2 $name]:",
" [string 'val'];",
"[tag tag] {",
" [tag inner] {",
" [property margin]: [number 3px];",
" }",
"}");
})();
-217
View File
@@ -1,217 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function() {
var mode = CodeMirror.getMode({indentUnit: 2}, "css");
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
// Error, because "foobarhello" is neither a known type or property, but
// property was expected (after "and"), and it should be in parentheses.
MT("atMediaUnknownType",
"[def @media] [attribute screen] [keyword and] [error foobarhello] { }");
// Soft error, because "foobarhello" is not a known property or type.
MT("atMediaUnknownProperty",
"[def @media] [attribute screen] [keyword and] ([error foobarhello]) { }");
// Make sure nesting works with media queries
MT("atMediaMaxWidthNested",
"[def @media] [attribute screen] [keyword and] ([property max-width]: [number 25px]) { [tag foo] { } }");
MT("atMediaFeatureValueKeyword",
"[def @media] ([property orientation]: [keyword landscape]) { }");
MT("atMediaUnknownFeatureValueKeyword",
"[def @media] ([property orientation]: [error upsidedown]) { }");
MT("atMediaUppercase",
"[def @MEDIA] ([property orienTAtion]: [keyword landScape]) { }");
MT("tagSelector",
"[tag foo] { }");
MT("classSelector",
"[qualifier .foo-bar_hello] { }");
MT("idSelector",
"[builtin #foo] { [error #foo] }");
MT("tagSelectorUnclosed",
"[tag foo] { [property margin]: [number 0] } [tag bar] { }");
MT("tagStringNoQuotes",
"[tag foo] { [property font-family]: [variable hello] [variable world]; }");
MT("tagStringDouble",
"[tag foo] { [property font-family]: [string \"hello world\"]; }");
MT("tagStringSingle",
"[tag foo] { [property font-family]: [string 'hello world']; }");
MT("tagColorKeyword",
"[tag foo] {",
" [property color]: [keyword black];",
" [property color]: [keyword navy];",
" [property color]: [keyword yellow];",
"}");
MT("tagColorHex3",
"[tag foo] { [property background]: [atom #fff]; }");
MT("tagColorHex4",
"[tag foo] { [property background]: [atom #ffff]; }");
MT("tagColorHex6",
"[tag foo] { [property background]: [atom #ffffff]; }");
MT("tagColorHex8",
"[tag foo] { [property background]: [atom #ffffffff]; }");
MT("tagColorHex5Invalid",
"[tag foo] { [property background]: [atom&error #fffff]; }");
MT("tagColorHexInvalid",
"[tag foo] { [property background]: [atom&error #ffg]; }");
MT("tagNegativeNumber",
"[tag foo] { [property margin]: [number -5px]; }");
MT("tagPositiveNumber",
"[tag foo] { [property padding]: [number 5px]; }");
MT("tagVendor",
"[tag foo] { [meta -foo-][property box-sizing]: [meta -foo-][atom border-box]; }");
MT("tagBogusProperty",
"[tag foo] { [property&error barhelloworld]: [number 0]; }");
MT("tagTwoProperties",
"[tag foo] { [property margin]: [number 0]; [property padding]: [number 0]; }");
MT("tagTwoPropertiesURL",
"[tag foo] { [property background]: [variable&callee url]([string //example.com/foo.png]); [property padding]: [number 0]; }");
MT("indent_tagSelector",
"[tag strong], [tag em] {",
" [property background]: [variable&callee rgba](",
" [number 255], [number 255], [number 0], [number .2]",
" );",
"}");
MT("indent_atMedia",
"[def @media] {",
" [tag foo] {",
" [property color]:",
" [keyword yellow];",
" }",
"}");
MT("indent_comma",
"[tag foo] {",
" [property font-family]: [variable verdana],",
" [atom sans-serif];",
"}");
MT("indent_parentheses",
"[tag foo]:[variable-3 before] {",
" [property background]: [variable&callee url](",
"[string blahblah]",
"[string etc]",
"[string ]) [keyword !important];",
"}");
MT("font_face",
"[def @font-face] {",
" [property font-family]: [string 'myfont'];",
" [error nonsense]: [string 'abc'];",
" [property src]: [variable&callee url]([string http://blah]),",
" [variable&callee url]([string http://foo]);",
"}");
MT("empty_url",
"[def @import] [variable&callee url]() [attribute screen];");
MT("parens",
"[qualifier .foo] {",
" [property background-image]: [variable&callee fade]([atom #000], [number 20%]);",
" [property border-image]: [variable&callee linear-gradient](",
" [atom to] [atom bottom],",
" [variable&callee fade]([atom #000], [number 20%]) [number 0%],",
" [variable&callee fade]([atom #000], [number 20%]) [number 100%]",
" );",
"}");
MT("css_variable",
":[variable-3 root] {",
" [variable-2 --main-color]: [atom #06c];",
"}",
"[tag h1][builtin #foo] {",
" [property color]: [variable&callee var]([variable-2 --main-color]);",
"}");
MT("blank_css_variable",
":[variable-3 root] {",
" [variable-2 --]: [atom #06c];",
"}",
"[tag h1][builtin #foo] {",
" [property color]: [variable&callee var]([variable-2 --]);",
"}");
MT("supports",
"[def @supports] ([keyword not] (([property text-align-last]: [atom justify]) [keyword or] ([meta -moz-][property text-align-last]: [atom justify])) {",
" [property text-align-last]: [atom justify];",
"}");
MT("document",
"[def @document] [variable&callee url]([string http://blah]),",
" [variable&callee url-prefix]([string https://]),",
" [variable&callee domain]([string blah.com]),",
" [variable&callee regexp]([string \".*blah.+\"]) {",
" [builtin #id] {",
" [property background-color]: [keyword white];",
" }",
" [tag foo] {",
" [property font-family]: [variable Verdana], [atom sans-serif];",
" }",
"}");
MT("document_url",
"[def @document] [variable&callee url]([string http://blah]) { [qualifier .class] { } }");
MT("document_urlPrefix",
"[def @document] [variable&callee url-prefix]([string https://]) { [builtin #id] { } }");
MT("document_domain",
"[def @document] [variable&callee domain]([string blah.com]) { [tag foo] { } }");
MT("document_regexp",
"[def @document] [variable&callee regexp]([string \".*blah.+\"]) { [builtin #id] { } }");
MT("counter-style",
"[def @counter-style] [variable binary] {",
" [property system]: [atom numeric];",
" [property symbols]: [number 0] [number 1];",
" [property suffix]: [string \".\"];",
" [property range]: [atom infinite];",
" [property speak-as]: [atom numeric];",
"}");
MT("counter-style-additive-symbols",
"[def @counter-style] [variable simple-roman] {",
" [property system]: [atom additive];",
" [property additive-symbols]: [number 10] [variable X], [number 5] [variable V], [number 1] [variable I];",
" [property range]: [number 1] [number 49];",
"}");
MT("counter-style-use",
"[tag ol][qualifier .roman] { [property list-style]: [variable simple-roman]; }");
MT("counter-style-symbols",
"[tag ol] { [property list-style]: [variable&callee symbols]([atom cyclic] [string \"*\"] [string \"\\2020\"] [string \"\\2021\"] [string \"\\A7\"]); }");
MT("comment-does-not-disrupt",
"[def @font-face] [comment /* foo */] {",
" [property src]: [variable&callee url]([string x]);",
" [property font-family]: [variable One];",
"}")
})();
-152
View File
@@ -1,152 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"), require("../xml/xml"), require("../javascript/javascript"), require("../css/css"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror", "../xml/xml", "../javascript/javascript", "../css/css"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
var defaultTags = {
script: [
["lang", /(javascript|babel)/i, "javascript"],
["type", /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i, "javascript"],
["type", /./, "text/plain"],
[null, null, "javascript"]
],
style: [
["lang", /^css$/i, "css"],
["type", /^(text\/)?(x-)?(stylesheet|css)$/i, "css"],
["type", /./, "text/plain"],
[null, null, "css"]
]
};
function maybeBackup(stream, pat, style) {
var cur = stream.current(), close = cur.search(pat);
if (close > -1) {
stream.backUp(cur.length - close);
} else if (cur.match(/<\/?$/)) {
stream.backUp(cur.length);
if (!stream.match(pat, false)) stream.match(cur);
}
return style;
}
var attrRegexpCache = {};
function getAttrRegexp(attr) {
var regexp = attrRegexpCache[attr];
if (regexp) return regexp;
return attrRegexpCache[attr] = new RegExp("\\s+" + attr + "\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*");
}
function getAttrValue(text, attr) {
var match = text.match(getAttrRegexp(attr))
return match ? /^\s*(.*?)\s*$/.exec(match[2])[1] : ""
}
function getTagRegexp(tagName, anchored) {
return new RegExp((anchored ? "^" : "") + "<\/\s*" + tagName + "\s*>", "i");
}
function addTags(from, to) {
for (var tag in from) {
var dest = to[tag] || (to[tag] = []);
var source = from[tag];
for (var i = source.length - 1; i >= 0; i--)
dest.unshift(source[i])
}
}
function findMatchingMode(tagInfo, tagText) {
for (var i = 0; i < tagInfo.length; i++) {
var spec = tagInfo[i];
if (!spec[0] || spec[1].test(getAttrValue(tagText, spec[0]))) return spec[2];
}
}
CodeMirror.defineMode("htmlmixed", function (config, parserConfig) {
var htmlMode = CodeMirror.getMode(config, {
name: "xml",
htmlMode: true,
multilineTagIndentFactor: parserConfig.multilineTagIndentFactor,
multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag
});
var tags = {};
var configTags = parserConfig && parserConfig.tags, configScript = parserConfig && parserConfig.scriptTypes;
addTags(defaultTags, tags);
if (configTags) addTags(configTags, tags);
if (configScript) for (var i = configScript.length - 1; i >= 0; i--)
tags.script.unshift(["type", configScript[i].matches, configScript[i].mode])
function html(stream, state) {
var style = htmlMode.token(stream, state.htmlState), tag = /\btag\b/.test(style), tagName
if (tag && !/[<>\s\/]/.test(stream.current()) &&
(tagName = state.htmlState.tagName && state.htmlState.tagName.toLowerCase()) &&
tags.hasOwnProperty(tagName)) {
state.inTag = tagName + " "
} else if (state.inTag && tag && />$/.test(stream.current())) {
var inTag = /^([\S]+) (.*)/.exec(state.inTag)
state.inTag = null
var modeSpec = stream.current() == ">" && findMatchingMode(tags[inTag[1]], inTag[2])
var mode = CodeMirror.getMode(config, modeSpec)
var endTagA = getTagRegexp(inTag[1], true), endTag = getTagRegexp(inTag[1], false);
state.token = function (stream, state) {
if (stream.match(endTagA, false)) {
state.token = html;
state.localState = state.localMode = null;
return null;
}
return maybeBackup(stream, endTag, state.localMode.token(stream, state.localState));
};
state.localMode = mode;
state.localState = CodeMirror.startState(mode, htmlMode.indent(state.htmlState, "", ""));
} else if (state.inTag) {
state.inTag += stream.current()
if (stream.eol()) state.inTag += " "
}
return style;
};
return {
startState: function () {
var state = CodeMirror.startState(htmlMode);
return {token: html, inTag: null, localMode: null, localState: null, htmlState: state};
},
copyState: function (state) {
var local;
if (state.localState) {
local = CodeMirror.copyState(state.localMode, state.localState);
}
return {token: state.token, inTag: state.inTag,
localMode: state.localMode, localState: local,
htmlState: CodeMirror.copyState(htmlMode, state.htmlState)};
},
token: function (stream, state) {
return state.token(stream, state);
},
indent: function (state, textAfter, line) {
if (!state.localMode || /^\s*<\//.test(textAfter))
return htmlMode.indent(state.htmlState, textAfter, line);
else if (state.localMode.indent)
return state.localMode.indent(state.localState, textAfter, line);
else
return CodeMirror.Pass;
},
innerMode: function (state) {
return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode};
}
};
}, "xml", "javascript", "css");
CodeMirror.defineMIME("text/html", "htmlmixed");
});
-100
View File
@@ -1,100 +0,0 @@
<!doctype html>
<title>CodeMirror: HTML mixed mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">
<link rel="stylesheet" href="../../lib/codemirror.css">
<script src="../../lib/codemirror.js"></script>
<script src="../../addon/selection/selection-pointer.js"></script>
<script src="../xml/xml.js"></script>
<script src="../javascript/javascript.js"></script>
<script src="../css/css.js"></script>
<script src="../vbscript/vbscript.js"></script>
<script src="htmlmixed.js"></script>
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
<div id=nav>
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
<ul>
<li><a href="../../index.html">Home</a>
<li><a href="../../doc/manual.html">Manual</a>
<li><a href="https://github.com/codemirror/codemirror">Code</a>
</ul>
<ul>
<li><a href="../index.html">Language modes</a>
<li><a class=active href="#">HTML mixed</a>
</ul>
</div>
<article>
<h2>HTML mixed mode</h2>
<form><textarea id="code" name="code">
<html style="color: green">
<!-- this is a comment -->
<head>
<title>Mixed HTML Example</title>
<style>
h1 {font-family: comic sans; color: #f0f;}
div {background: yellow !important;}
body {
max-width: 50em;
margin: 1em 2em 1em 5em;
}
</style>
</head>
<body>
<h1>Mixed HTML Example</h1>
<script>
function jsFunc(arg1, arg2) {
if (arg1 && arg2) document.body.innerHTML = "achoo";
}
</script>
</body>
</html>
</textarea></form>
<script>
// Define an extended mixed-mode that understands vbscript and
// leaves mustache/handlebars embedded templates in html mode
var mixedMode = {
name: "htmlmixed",
scriptTypes: [{matches: /\/x-handlebars-template|\/x-mustache/i,
mode: null},
{matches: /(text|application)\/(x-)?vb(a|script)/i,
mode: "vbscript"}]
};
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
mode: mixedMode,
selectionPointer: true
});
</script>
<p>The HTML mixed mode depends on the XML, JavaScript, and CSS modes.</p>
<p>It takes an optional mode configuration
option, <code>tags</code>, which can be used to add custom
behavior for specific tags. When given, it should be an object
mapping tag names (for example <code>script</code>) to arrays or
three-element arrays. Those inner arrays indicate [attributeName,
valueRegexp, <a href="../../doc/manual.html#option_mode">modeSpec</a>]
specifications. For example, you could use <code>["type", /^foo$/,
"foo"]</code> to map the attribute <code>type="foo"</code> to
the <code>foo</code> mode. When the first two fields are null
(<code>[null, null, "mode"]</code>), the given mode is used for
any such tag that doesn't match any of the previously given
attributes. For example:</p>
<pre>var myModeSpec = {
name: "htmlmixed",
tags: {
style: [["type", /^text\/(x-)?scss$/, "text/x-scss"],
[null, null, "css"]],
custom: [[null, null, "customMode"]]
}
}</pre>
<p><strong>MIME types defined:</strong> <code>text/html</code>
(redefined, only takes effect if you load this parser after the
XML parser).</p>
</article>
-114
View File
@@ -1,114 +0,0 @@
<!doctype html>
<title>CodeMirror: JavaScript mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">
<link rel="stylesheet" href="../../lib/codemirror.css">
<script src="../../lib/codemirror.js"></script>
<script src="../../addon/edit/matchbrackets.js"></script>
<script src="../../addon/comment/continuecomment.js"></script>
<script src="../../addon/comment/comment.js"></script>
<script src="javascript.js"></script>
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
<div id=nav>
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
<ul>
<li><a href="../../index.html">Home</a>
<li><a href="../../doc/manual.html">Manual</a>
<li><a href="https://github.com/codemirror/codemirror">Code</a>
</ul>
<ul>
<li><a href="../index.html">Language modes</a>
<li><a class=active href="#">JavaScript</a>
</ul>
</div>
<article>
<h2>JavaScript mode</h2>
<div><textarea id="code" name="code">
// Demo code (the actual new parser character stream implementation)
function StringStream(string) {
this.pos = 0;
this.string = string;
}
StringStream.prototype = {
done: function() {return this.pos >= this.string.length;},
peek: function() {return this.string.charAt(this.pos);},
next: function() {
if (this.pos &lt; 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 &amp;&amp; match.test ? match.test(ch) : match(ch);
if (ok) {this.pos++; return ch;}
},
eatWhile: function(match) {
var start = this.pos;
while (this.eat(match));
if (this.pos > start) return this.string.slice(start, this.pos);
},
backUp: function(n) {this.pos -= n;},
column: function() {return this.pos;},
eatSpace: function() {
var start = this.pos;
while (/\s/.test(this.string.charAt(this.pos))) this.pos++;
return this.pos - start;
},
match: function(pattern, consume, caseInsensitive) {
if (typeof pattern == "string") {
function cased(str) {return caseInsensitive ? str.toLowerCase() : str;}
if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) {
if (consume !== false) this.pos += str.length;
return true;
}
}
else {
var match = this.string.slice(this.pos).match(pattern);
if (match &amp;&amp; consume !== false) this.pos += match[0].length;
return match;
}
}
};
</textarea></div>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
matchBrackets: true,
continueComments: "Enter",
extraKeys: {"Ctrl-Q": "toggleComment"}
});
</script>
<p>
JavaScript mode supports several configuration options:
<ul>
<li><code>json</code> which will set the mode to expect JSON
data rather than a JavaScript program.</li>
<li><code>jsonld</code> which will set the mode to expect
<a href="http://json-ld.org">JSON-LD</a> linked data rather
than a JavaScript program (<a href="json-ld.html">demo</a>).</li>
<li><code>typescript</code> which will activate additional
syntax highlighting and some other things for TypeScript code
(<a href="typescript.html">demo</a>).</li>
<li><code>statementIndent</code> which (given a number) will
determine the amount of indentation to use for statements
continued on a new line.</li>
<li><code>wordCharacters</code>, a regexp that indicates which
characters should be considered part of an identifier.
Defaults to <code>/[\w$]/</code>, which does not handle
non-ASCII identifiers. Can be set to something more elaborate
to improve Unicode support.</li>
</ul>
</p>
<p><strong>MIME types defined:</strong> <code>text/javascript</code>, <code>application/json</code>, <code>application/ld+json</code>, <code>text/typescript</code>, <code>application/typescript</code>.</p>
</article>
-913
View File
@@ -1,913 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
CodeMirror.defineMode("javascript", function(config, parserConfig) {
var indentUnit = config.indentUnit;
var statementIndent = parserConfig.statementIndent;
var jsonldMode = parserConfig.jsonld;
var jsonMode = parserConfig.json || jsonldMode;
var isTS = parserConfig.typescript;
var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/;
// Tokenizer
var keywords = function(){
function kw(type) {return {type: type, style: "keyword"};}
var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"), D = kw("keyword d");
var operator = kw("operator"), atom = {type: "atom", style: "atom"};
return {
"if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B,
"return": D, "break": D, "continue": D, "new": kw("new"), "delete": C, "void": C, "throw": C,
"debugger": kw("debugger"), "var": kw("var"), "const": kw("var"), "let": kw("var"),
"function": kw("function"), "catch": kw("catch"),
"for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
"in": operator, "typeof": operator, "instanceof": operator,
"true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom,
"this": kw("this"), "class": kw("class"), "super": kw("atom"),
"yield": C, "export": kw("export"), "import": kw("import"), "extends": C,
"await": C
};
}();
var isOperatorChar = /[+\-*&%=<>!?|~^@]/;
var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;
function readRegexp(stream) {
var escaped = false, next, inSet = false;
while ((next = stream.next()) != null) {
if (!escaped) {
if (next == "/" && !inSet) return;
if (next == "[") inSet = true;
else if (inSet && next == "]") inSet = false;
}
escaped = !escaped && next == "\\";
}
}
// Used as scratch variables to communicate multiple values without
// consing up tons of objects.
var type, content;
function ret(tp, style, cont) {
type = tp; content = cont;
return style;
}
function tokenBase(stream, state) {
var ch = stream.next();
if (ch == '"' || ch == "'") {
state.tokenize = tokenString(ch);
return state.tokenize(stream, state);
} else if (ch == "." && stream.match(/^\d+(?:[eE][+\-]?\d+)?/)) {
return ret("number", "number");
} else if (ch == "." && stream.match("..")) {
return ret("spread", "meta");
} else if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
return ret(ch);
} else if (ch == "=" && stream.eat(">")) {
return ret("=>", "operator");
} else if (ch == "0" && stream.match(/^(?:x[\da-f]+|o[0-7]+|b[01]+)n?/i)) {
return ret("number", "number");
} else if (/\d/.test(ch)) {
stream.match(/^\d*(?:n|(?:\.\d*)?(?:[eE][+\-]?\d+)?)?/);
return ret("number", "number");
} else if (ch == "/") {
if (stream.eat("*")) {
state.tokenize = tokenComment;
return tokenComment(stream, state);
} else if (stream.eat("/")) {
stream.skipToEnd();
return ret("comment", "comment");
} else if (expressionAllowed(stream, state, 1)) {
readRegexp(stream);
stream.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/);
return ret("regexp", "string-2");
} else {
stream.eat("=");
return ret("operator", "operator", stream.current());
}
} else if (ch == "`") {
state.tokenize = tokenQuasi;
return tokenQuasi(stream, state);
} else if (ch == "#") {
stream.skipToEnd();
return ret("error", "error");
} else if (isOperatorChar.test(ch)) {
if (ch != ">" || !state.lexical || state.lexical.type != ">") {
if (stream.eat("=")) {
if (ch == "!" || ch == "=") stream.eat("=")
} else if (/[<>*+\-]/.test(ch)) {
stream.eat(ch)
if (ch == ">") stream.eat(ch)
}
}
return ret("operator", "operator", stream.current());
} else if (wordRE.test(ch)) {
stream.eatWhile(wordRE);
var word = stream.current()
if (state.lastType != ".") {
if (keywords.propertyIsEnumerable(word)) {
var kw = keywords[word]
return ret(kw.type, kw.style, word)
}
if (word == "async" && stream.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/, false))
return ret("async", "keyword", word)
}
return ret("variable", "variable", word)
}
}
function tokenString(quote) {
return function(stream, state) {
var escaped = false, next;
if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)){
state.tokenize = tokenBase;
return ret("jsonld-keyword", "meta");
}
while ((next = stream.next()) != null) {
if (next == quote && !escaped) break;
escaped = !escaped && next == "\\";
}
if (!escaped) state.tokenize = tokenBase;
return ret("string", "string");
};
}
function tokenComment(stream, state) {
var maybeEnd = false, ch;
while (ch = stream.next()) {
if (ch == "/" && maybeEnd) {
state.tokenize = tokenBase;
break;
}
maybeEnd = (ch == "*");
}
return ret("comment", "comment");
}
function tokenQuasi(stream, state) {
var escaped = false, next;
while ((next = stream.next()) != null) {
if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) {
state.tokenize = tokenBase;
break;
}
escaped = !escaped && next == "\\";
}
return ret("quasi", "string-2", stream.current());
}
var brackets = "([{}])";
// This is a crude lookahead trick to try and notice that we're
// parsing the argument patterns for a fat-arrow function before we
// actually hit the arrow token. It only works if the arrow is on
// the same line as the arguments and there's no strange noise
// (comments) in between. Fallback is to only notice when we hit the
// arrow, and not declare the arguments as locals for the arrow
// body.
function findFatArrow(stream, state) {
if (state.fatArrowAt) state.fatArrowAt = null;
var arrow = stream.string.indexOf("=>", stream.start);
if (arrow < 0) return;
if (isTS) { // Try to skip TypeScript return type declarations after the arguments
var m = /:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(stream.string.slice(stream.start, arrow))
if (m) arrow = m.index
}
var depth = 0, sawSomething = false;
for (var pos = arrow - 1; pos >= 0; --pos) {
var ch = stream.string.charAt(pos);
var bracket = brackets.indexOf(ch);
if (bracket >= 0 && bracket < 3) {
if (!depth) { ++pos; break; }
if (--depth == 0) { if (ch == "(") sawSomething = true; break; }
} else if (bracket >= 3 && bracket < 6) {
++depth;
} else if (wordRE.test(ch)) {
sawSomething = true;
} else if (/["'\/]/.test(ch)) {
return;
} else if (sawSomething && !depth) {
++pos;
break;
}
}
if (sawSomething && !depth) state.fatArrowAt = pos;
}
// Parser
var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true, "jsonld-keyword": true};
function JSLexical(indented, column, type, align, prev, info) {
this.indented = indented;
this.column = column;
this.type = type;
this.prev = prev;
this.info = info;
if (align != null) this.align = align;
}
function inScope(state, varname) {
for (var v = state.localVars; v; v = v.next)
if (v.name == varname) return true;
for (var cx = state.context; cx; cx = cx.prev) {
for (var v = cx.vars; v; v = v.next)
if (v.name == varname) return true;
}
}
function parseJS(state, style, type, content, stream) {
var cc = state.cc;
// Communicate our context to the combinators.
// (Less wasteful than consing up a hundred closures on every call.)
cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style;
if (!state.lexical.hasOwnProperty("align"))
state.lexical.align = true;
while(true) {
var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;
if (combinator(type, content)) {
while(cc.length && cc[cc.length - 1].lex)
cc.pop()();
if (cx.marked) return cx.marked;
if (type == "variable" && inScope(state, content)) return "variable-2";
return style;
}
}
}
// Combinator utils
var cx = {state: null, column: null, marked: null, cc: null};
function pass() {
for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);
}
function cont() {
pass.apply(null, arguments);
return true;
}
function inList(name, list) {
for (var v = list; v; v = v.next) if (v.name == name) return true
return false;
}
function register(varname) {
var state = cx.state;
cx.marked = "def";
if (state.context) {
if (state.lexical.info == "var" && state.context && state.context.block) {
// FIXME function decls are also not block scoped
var newContext = registerVarScoped(varname, state.context)
if (newContext != null) {
state.context = newContext
return
}
} else if (!inList(varname, state.localVars)) {
state.localVars = new Var(varname, state.localVars)
return
}
}
// Fall through means this is global
if (parserConfig.globalVars && !inList(varname, state.globalVars))
state.globalVars = new Var(varname, state.globalVars)
}
function registerVarScoped(varname, context) {
if (!context) {
return null
} else if (context.block) {
var inner = registerVarScoped(varname, context.prev)
if (!inner) return null
if (inner == context.prev) return context
return new Context(inner, context.vars, true)
} else if (inList(varname, context.vars)) {
return context
} else {
return new Context(context.prev, new Var(varname, context.vars), false)
}
}
function isModifier(name) {
return name == "public" || name == "private" || name == "protected" || name == "abstract" || name == "readonly"
}
// Combinators
function Context(prev, vars, block) { this.prev = prev; this.vars = vars; this.block = block }
function Var(name, next) { this.name = name; this.next = next }
var defaultVars = new Var("this", new Var("arguments", null))
function pushcontext() {
cx.state.context = new Context(cx.state.context, cx.state.localVars, false)
cx.state.localVars = defaultVars
}
function pushblockcontext() {
cx.state.context = new Context(cx.state.context, cx.state.localVars, true)
cx.state.localVars = null
}
function popcontext() {
cx.state.localVars = cx.state.context.vars
cx.state.context = cx.state.context.prev
}
popcontext.lex = true
function pushlex(type, info) {
var result = function() {
var state = cx.state, indent = state.indented;
if (state.lexical.type == "stat") indent = state.lexical.indented;
else for (var outer = state.lexical; outer && outer.type == ")" && outer.align; outer = outer.prev)
indent = outer.indented;
state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info);
};
result.lex = true;
return result;
}
function poplex() {
var state = cx.state;
if (state.lexical.prev) {
if (state.lexical.type == ")")
state.indented = state.lexical.indented;
state.lexical = state.lexical.prev;
}
}
poplex.lex = true;
function expect(wanted) {
function exp(type) {
if (type == wanted) return cont();
else if (wanted == ";" || type == "}" || type == ")" || type == "]") return pass();
else return cont(exp);
};
return exp;
}
function statement(type, value) {
if (type == "var") return cont(pushlex("vardef", value), vardef, expect(";"), poplex);
if (type == "keyword a") return cont(pushlex("form"), parenExpr, statement, poplex);
if (type == "keyword b") return cont(pushlex("form"), statement, poplex);
if (type == "keyword d") return cx.stream.match(/^\s*$/, false) ? cont() : cont(pushlex("stat"), maybeexpression, expect(";"), poplex);
if (type == "debugger") return cont(expect(";"));
if (type == "{") return cont(pushlex("}"), pushblockcontext, block, poplex, popcontext);
if (type == ";") return cont();
if (type == "if") {
if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex)
cx.state.cc.pop()();
return cont(pushlex("form"), parenExpr, statement, poplex, maybeelse);
}
if (type == "function") return cont(functiondef);
if (type == "for") return cont(pushlex("form"), forspec, statement, poplex);
if (type == "class" || (isTS && value == "interface")) {
cx.marked = "keyword"
return cont(pushlex("form", type == "class" ? type : value), className, poplex)
}
if (type == "variable") {
if (isTS && value == "declare") {
cx.marked = "keyword"
return cont(statement)
} else if (isTS && (value == "module" || value == "enum" || value == "type") && cx.stream.match(/^\s*\w/, false)) {
cx.marked = "keyword"
if (value == "enum") return cont(enumdef);
else if (value == "type") return cont(typeexpr, expect("operator"), typeexpr, expect(";"));
else return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex)
} else if (isTS && value == "namespace") {
cx.marked = "keyword"
return cont(pushlex("form"), expression, statement, poplex)
} else if (isTS && value == "abstract") {
cx.marked = "keyword"
return cont(statement)
} else {
return cont(pushlex("stat"), maybelabel);
}
}
if (type == "switch") return cont(pushlex("form"), parenExpr, expect("{"), pushlex("}", "switch"), pushblockcontext,
block, poplex, poplex, popcontext);
if (type == "case") return cont(expression, expect(":"));
if (type == "default") return cont(expect(":"));
if (type == "catch") return cont(pushlex("form"), pushcontext, maybeCatchBinding, statement, poplex, popcontext);
if (type == "export") return cont(pushlex("stat"), afterExport, poplex);
if (type == "import") return cont(pushlex("stat"), afterImport, poplex);
if (type == "async") return cont(statement)
if (value == "@") return cont(expression, statement)
return pass(pushlex("stat"), expression, expect(";"), poplex);
}
function maybeCatchBinding(type) {
if (type == "(") return cont(funarg, expect(")"))
}
function expression(type, value) {
return expressionInner(type, value, false);
}
function expressionNoComma(type, value) {
return expressionInner(type, value, true);
}
function parenExpr(type) {
if (type != "(") return pass()
return cont(pushlex(")"), expression, expect(")"), poplex)
}
function expressionInner(type, value, noComma) {
if (cx.state.fatArrowAt == cx.stream.start) {
var body = noComma ? arrowBodyNoComma : arrowBody;
if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, expect("=>"), body, popcontext);
else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext);
}
var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;
if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);
if (type == "function") return cont(functiondef, maybeop);
if (type == "class" || (isTS && value == "interface")) { cx.marked = "keyword"; return cont(pushlex("form"), classExpression, poplex); }
if (type == "keyword c" || type == "async") return cont(noComma ? expressionNoComma : expression);
if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeop);
if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression);
if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop);
if (type == "{") return contCommasep(objprop, "}", null, maybeop);
if (type == "quasi") return pass(quasi, maybeop);
if (type == "new") return cont(maybeTarget(noComma));
if (type == "import") return cont(expression);
return cont();
}
function maybeexpression(type) {
if (type.match(/[;\}\)\],]/)) return pass();
return pass(expression);
}
function maybeoperatorComma(type, value) {
if (type == ",") return cont(expression);
return maybeoperatorNoComma(type, value, false);
}
function maybeoperatorNoComma(type, value, noComma) {
var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;
var expr = noComma == false ? expression : expressionNoComma;
if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);
if (type == "operator") {
if (/\+\+|--/.test(value) || isTS && value == "!") return cont(me);
if (isTS && value == "<" && cx.stream.match(/^([^>]|<.*?>)*>\s*\(/, false))
return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, me);
if (value == "?") return cont(expression, expect(":"), expr);
return cont(expr);
}
if (type == "quasi") { return pass(quasi, me); }
if (type == ";") return;
if (type == "(") return contCommasep(expressionNoComma, ")", "call", me);
if (type == ".") return cont(property, me);
if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me);
if (isTS && value == "as") { cx.marked = "keyword"; return cont(typeexpr, me) }
if (type == "regexp") {
cx.state.lastType = cx.marked = "operator"
cx.stream.backUp(cx.stream.pos - cx.stream.start - 1)
return cont(expr)
}
}
function quasi(type, value) {
if (type != "quasi") return pass();
if (value.slice(value.length - 2) != "${") return cont(quasi);
return cont(expression, continueQuasi);
}
function continueQuasi(type) {
if (type == "}") {
cx.marked = "string-2";
cx.state.tokenize = tokenQuasi;
return cont(quasi);
}
}
function arrowBody(type) {
findFatArrow(cx.stream, cx.state);
return pass(type == "{" ? statement : expression);
}
function arrowBodyNoComma(type) {
findFatArrow(cx.stream, cx.state);
return pass(type == "{" ? statement : expressionNoComma);
}
function maybeTarget(noComma) {
return function(type) {
if (type == ".") return cont(noComma ? targetNoComma : target);
else if (type == "variable" && isTS) return cont(maybeTypeArgs, noComma ? maybeoperatorNoComma : maybeoperatorComma)
else return pass(noComma ? expressionNoComma : expression);
};
}
function target(_, value) {
if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorComma); }
}
function targetNoComma(_, value) {
if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorNoComma); }
}
function maybelabel(type) {
if (type == ":") return cont(poplex, statement);
return pass(maybeoperatorComma, expect(";"), poplex);
}
function property(type) {
if (type == "variable") {cx.marked = "property"; return cont();}
}
function objprop(type, value) {
if (type == "async") {
cx.marked = "property";
return cont(objprop);
} else if (type == "variable" || cx.style == "keyword") {
cx.marked = "property";
if (value == "get" || value == "set") return cont(getterSetter);
var m // Work around fat-arrow-detection complication for detecting typescript typed arrow params
if (isTS && cx.state.fatArrowAt == cx.stream.start && (m = cx.stream.match(/^\s*:\s*/, false)))
cx.state.fatArrowAt = cx.stream.pos + m[0].length
return cont(afterprop);
} else if (type == "number" || type == "string") {
cx.marked = jsonldMode ? "property" : (cx.style + " property");
return cont(afterprop);
} else if (type == "jsonld-keyword") {
return cont(afterprop);
} else if (isTS && isModifier(value)) {
cx.marked = "keyword"
return cont(objprop)
} else if (type == "[") {
return cont(expression, maybetype, expect("]"), afterprop);
} else if (type == "spread") {
return cont(expressionNoComma, afterprop);
} else if (value == "*") {
cx.marked = "keyword";
return cont(objprop);
} else if (type == ":") {
return pass(afterprop)
}
}
function getterSetter(type) {
if (type != "variable") return pass(afterprop);
cx.marked = "property";
return cont(functiondef);
}
function afterprop(type) {
if (type == ":") return cont(expressionNoComma);
if (type == "(") return pass(functiondef);
}
function commasep(what, end, sep) {
function proceed(type, value) {
if (sep ? sep.indexOf(type) > -1 : type == ",") {
var lex = cx.state.lexical;
if (lex.info == "call") lex.pos = (lex.pos || 0) + 1;
return cont(function(type, value) {
if (type == end || value == end) return pass()
return pass(what)
}, proceed);
}
if (type == end || value == end) return cont();
if (sep && sep.indexOf(";") > -1) return pass(what)
return cont(expect(end));
}
return function(type, value) {
if (type == end || value == end) return cont();
return pass(what, proceed);
};
}
function contCommasep(what, end, info) {
for (var i = 3; i < arguments.length; i++)
cx.cc.push(arguments[i]);
return cont(pushlex(end, info), commasep(what, end), poplex);
}
function block(type) {
if (type == "}") return cont();
return pass(statement, block);
}
function maybetype(type, value) {
if (isTS) {
if (type == ":") return cont(typeexpr);
if (value == "?") return cont(maybetype);
}
}
function mayberettype(type) {
if (isTS && type == ":") {
if (cx.stream.match(/^\s*\w+\s+is\b/, false)) return cont(expression, isKW, typeexpr)
else return cont(typeexpr)
}
}
function isKW(_, value) {
if (value == "is") {
cx.marked = "keyword"
return cont()
}
}
function typeexpr(type, value) {
if (value == "keyof" || value == "typeof") {
cx.marked = "keyword"
return cont(value == "keyof" ? typeexpr : expressionNoComma)
}
if (type == "variable" || value == "void") {
cx.marked = "type"
return cont(afterType)
}
if (type == "string" || type == "number" || type == "atom") return cont(afterType);
if (type == "[") return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType)
if (type == "{") return cont(pushlex("}"), commasep(typeprop, "}", ",;"), poplex, afterType)
if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType)
if (type == "<") return cont(commasep(typeexpr, ">"), typeexpr)
}
function maybeReturnType(type) {
if (type == "=>") return cont(typeexpr)
}
function typeprop(type, value) {
if (type == "variable" || cx.style == "keyword") {
cx.marked = "property"
return cont(typeprop)
} else if (value == "?") {
return cont(typeprop)
} else if (type == ":") {
return cont(typeexpr)
} else if (type == "[") {
return cont(expression, maybetype, expect("]"), typeprop)
} else if (type == "(") {
return cont(pushlex(")"), commasep(funarg, ")"), poplex, typeprop)
}
}
function typearg(type, value) {
if (type == "variable" && cx.stream.match(/^\s*[?:]/, false) || value == "?") return cont(typearg)
if (type == ":") return cont(typeexpr)
return pass(typeexpr)
}
function afterType(type, value) {
if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
if (value == "|" || type == "." || value == "&") return cont(typeexpr)
if (type == "[") return cont(expect("]"), afterType)
if (value == "extends" || value == "implements") { cx.marked = "keyword"; return cont(typeexpr) }
}
function maybeTypeArgs(_, value) {
if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
}
function typeparam() {
return pass(typeexpr, maybeTypeDefault)
}
function maybeTypeDefault(_, value) {
if (value == "=") return cont(typeexpr)
}
function vardef(_, value) {
if (value == "enum") {cx.marked = "keyword"; return cont(enumdef)}
return pass(pattern, maybetype, maybeAssign, vardefCont);
}
function pattern(type, value) {
if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(pattern) }
if (type == "variable") { register(value); return cont(); }
if (type == "spread") return cont(pattern);
if (type == "[") return contCommasep(eltpattern, "]");
if (type == "{") return contCommasep(proppattern, "}");
}
function proppattern(type, value) {
if (type == "variable" && !cx.stream.match(/^\s*:/, false)) {
register(value);
return cont(maybeAssign);
}
if (type == "variable") cx.marked = "property";
if (type == "spread") return cont(pattern);
if (type == "}") return pass();
if (type == "[") return cont(expression, expect(']'), expect(':'), proppattern);
return cont(expect(":"), pattern, maybeAssign);
}
function eltpattern() {
return pass(pattern, maybeAssign)
}
function maybeAssign(_type, value) {
if (value == "=") return cont(expressionNoComma);
}
function vardefCont(type) {
if (type == ",") return cont(vardef);
}
function maybeelse(type, value) {
if (type == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex);
}
function forspec(type, value) {
if (value == "await") return cont(forspec);
if (type == "(") return cont(pushlex(")"), forspec1, expect(")"), poplex);
}
function forspec1(type) {
if (type == "var") return cont(vardef, expect(";"), forspec2);
if (type == ";") return cont(forspec2);
if (type == "variable") return cont(formaybeinof);
return pass(expression, expect(";"), forspec2);
}
function formaybeinof(_type, value) {
if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); }
return cont(maybeoperatorComma, forspec2);
}
function forspec2(type, value) {
if (type == ";") return cont(forspec3);
if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); }
return pass(expression, expect(";"), forspec3);
}
function forspec3(type) {
if (type != ")") cont(expression);
}
function functiondef(type, value) {
if (value == "*") {cx.marked = "keyword"; return cont(functiondef);}
if (type == "variable") {register(value); return cont(functiondef);}
if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, statement, popcontext);
if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondef)
}
function functiondecl(type, value) {
if (value == "*") {cx.marked = "keyword"; return cont(functiondecl);}
if (type == "variable") {register(value); return cont(functiondecl);}
if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, popcontext);
if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondecl)
}
function funarg(type, value) {
if (value == "@") cont(expression, funarg)
if (type == "spread") return cont(funarg);
if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(funarg); }
return pass(pattern, maybetype, maybeAssign);
}
function classExpression(type, value) {
// Class expressions may have an optional name.
if (type == "variable") return className(type, value);
return classNameAfter(type, value);
}
function className(type, value) {
if (type == "variable") {register(value); return cont(classNameAfter);}
}
function classNameAfter(type, value) {
if (value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, classNameAfter)
if (value == "extends" || value == "implements" || (isTS && type == ",")) {
if (value == "implements") cx.marked = "keyword";
return cont(isTS ? typeexpr : expression, classNameAfter);
}
if (type == "{") return cont(pushlex("}"), classBody, poplex);
}
function classBody(type, value) {
if (type == "async" ||
(type == "variable" &&
(value == "static" || value == "get" || value == "set" || (isTS && isModifier(value))) &&
cx.stream.match(/^\s+[\w$\xa1-\uffff]/, false))) {
cx.marked = "keyword";
return cont(classBody);
}
if (type == "variable" || cx.style == "keyword") {
cx.marked = "property";
return cont(isTS ? classfield : functiondef, classBody);
}
if (type == "[")
return cont(expression, maybetype, expect("]"), isTS ? classfield : functiondef, classBody)
if (value == "*") {
cx.marked = "keyword";
return cont(classBody);
}
if (type == ";") return cont(classBody);
if (type == "}") return cont();
if (value == "@") return cont(expression, classBody)
}
function classfield(type, value) {
if (value == "?") return cont(classfield)
if (type == ":") return cont(typeexpr, maybeAssign)
if (value == "=") return cont(expressionNoComma)
var context = cx.state.lexical.prev, isInterface = context && context.info == "interface"
return pass(isInterface ? functiondecl : functiondef)
}
function afterExport(type, value) {
if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); }
if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); }
if (type == "{") return cont(commasep(exportField, "}"), maybeFrom, expect(";"));
return pass(statement);
}
function exportField(type, value) {
if (value == "as") { cx.marked = "keyword"; return cont(expect("variable")); }
if (type == "variable") return pass(expressionNoComma, exportField);
}
function afterImport(type) {
if (type == "string") return cont();
if (type == "(") return pass(expression);
return pass(importSpec, maybeMoreImports, maybeFrom);
}
function importSpec(type, value) {
if (type == "{") return contCommasep(importSpec, "}");
if (type == "variable") register(value);
if (value == "*") cx.marked = "keyword";
return cont(maybeAs);
}
function maybeMoreImports(type) {
if (type == ",") return cont(importSpec, maybeMoreImports)
}
function maybeAs(_type, value) {
if (value == "as") { cx.marked = "keyword"; return cont(importSpec); }
}
function maybeFrom(_type, value) {
if (value == "from") { cx.marked = "keyword"; return cont(expression); }
}
function arrayLiteral(type) {
if (type == "]") return cont();
return pass(commasep(expressionNoComma, "]"));
}
function enumdef() {
return pass(pushlex("form"), pattern, expect("{"), pushlex("}"), commasep(enummember, "}"), poplex, poplex)
}
function enummember() {
return pass(pattern, maybeAssign);
}
function isContinuedStatement(state, textAfter) {
return state.lastType == "operator" || state.lastType == "," ||
isOperatorChar.test(textAfter.charAt(0)) ||
/[,.]/.test(textAfter.charAt(0));
}
function expressionAllowed(stream, state, backUp) {
return state.tokenize == tokenBase &&
/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(state.lastType) ||
(state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))))
}
// Interface
return {
startState: function(basecolumn) {
var state = {
tokenize: tokenBase,
lastType: "sof",
cc: [],
lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false),
localVars: parserConfig.localVars,
context: parserConfig.localVars && new Context(null, null, false),
indented: basecolumn || 0
};
if (parserConfig.globalVars && typeof parserConfig.globalVars == "object")
state.globalVars = parserConfig.globalVars;
return state;
},
token: function(stream, state) {
if (stream.sol()) {
if (!state.lexical.hasOwnProperty("align"))
state.lexical.align = false;
state.indented = stream.indentation();
findFatArrow(stream, state);
}
if (state.tokenize != tokenComment && stream.eatSpace()) return null;
var style = state.tokenize(stream, state);
if (type == "comment") return style;
state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type;
return parseJS(state, style, type, content, stream);
},
indent: function(state, textAfter) {
if (state.tokenize == tokenComment) return CodeMirror.Pass;
if (state.tokenize != tokenBase) return 0;
var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top
// Kludge to prevent 'maybelse' from blocking lexical scope pops
if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {
var c = state.cc[i];
if (c == poplex) lexical = lexical.prev;
else if (c != maybeelse) break;
}
while ((lexical.type == "stat" || lexical.type == "form") &&
(firstChar == "}" || ((top = state.cc[state.cc.length - 1]) &&
(top == maybeoperatorComma || top == maybeoperatorNoComma) &&
!/^[,\.=+\-*:?[\(]/.test(textAfter))))
lexical = lexical.prev;
if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat")
lexical = lexical.prev;
var type = lexical.type, closing = firstChar == type;
if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info.length + 1 : 0);
else if (type == "form" && firstChar == "{") return lexical.indented;
else if (type == "form") return lexical.indented + indentUnit;
else if (type == "stat")
return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0);
else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false)
return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit);
else if (lexical.align) return lexical.column + (closing ? 0 : 1);
else return lexical.indented + (closing ? 0 : indentUnit);
},
electricInput: /^\s*(?:case .*?:|default:|\{|\})$/,
blockCommentStart: jsonMode ? null : "/*",
blockCommentEnd: jsonMode ? null : "*/",
blockCommentContinue: jsonMode ? null : " * ",
lineComment: jsonMode ? null : "//",
fold: "brace",
closeBrackets: "()[]{}''\"\"``",
helperType: jsonMode ? "json" : "javascript",
jsonldMode: jsonldMode,
jsonMode: jsonMode,
expressionAllowed: expressionAllowed,
skipExpression: function(state) {
var top = state.cc[state.cc.length - 1]
if (top == expression || top == expressionNoComma) state.cc.pop()
}
};
});
CodeMirror.registerHelper("wordChars", "javascript", /[\w$]/);
CodeMirror.defineMIME("text/javascript", "javascript");
CodeMirror.defineMIME("text/ecmascript", "javascript");
CodeMirror.defineMIME("application/javascript", "javascript");
CodeMirror.defineMIME("application/x-javascript", "javascript");
CodeMirror.defineMIME("application/ecmascript", "javascript");
CodeMirror.defineMIME("application/json", {name: "javascript", json: true});
CodeMirror.defineMIME("application/x-json", {name: "javascript", json: true});
CodeMirror.defineMIME("application/ld+json", {name: "javascript", jsonld: true});
CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true });
CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true });
});
-72
View File
@@ -1,72 +0,0 @@
<!doctype html>
<title>CodeMirror: JSON-LD mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">
<link rel="stylesheet" href="../../lib/codemirror.css">
<script src="../../lib/codemirror.js"></script>
<script src="../../addon/edit/matchbrackets.js"></script>
<script src="../../addon/comment/continuecomment.js"></script>
<script src="../../addon/comment/comment.js"></script>
<script src="javascript.js"></script>
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
<div id="nav">
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"/></a>
<ul>
<li><a href="../../index.html">Home</a>
<li><a href="../../doc/manual.html">Manual</a>
<li><a href="https://github.com/codemirror/codemirror">Code</a>
</ul>
<ul>
<li><a href="../index.html">Language modes</a>
<li><a class=active href="#">JSON-LD</a>
</ul>
</div>
<article>
<h2>JSON-LD mode</h2>
<div><textarea id="code" name="code">
{
"@context": {
"name": "http://schema.org/name",
"description": "http://schema.org/description",
"image": {
"@id": "http://schema.org/image",
"@type": "@id"
},
"geo": "http://schema.org/geo",
"latitude": {
"@id": "http://schema.org/latitude",
"@type": "xsd:float"
},
"longitude": {
"@id": "http://schema.org/longitude",
"@type": "xsd:float"
},
"xsd": "http://www.w3.org/2001/XMLSchema#"
},
"name": "The Empire State Building",
"description": "The Empire State Building is a 102-story landmark in New York City.",
"image": "http://www.civil.usherbrooke.ca/cours/gci215a/empire-state-building.jpg",
"geo": {
"latitude": "40.75",
"longitude": "73.98"
}
}
</textarea></div>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
matchBrackets: true,
autoCloseBrackets: true,
mode: "application/ld+json",
lineWrapping: true
});
</script>
<p>This is a specialization of the <a href="index.html">JavaScript mode</a>.</p>
</article>
-494
View File
@@ -1,494 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function() {
var mode = CodeMirror.getMode({indentUnit: 2}, "javascript");
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
MT("locals",
"[keyword function] [def foo]([def a], [def b]) { [keyword var] [def c] [operator =] [number 10]; [keyword return] [variable-2 a] [operator +] [variable-2 c] [operator +] [variable d]; }");
MT("comma-and-binop",
"[keyword function](){ [keyword var] [def x] [operator =] [number 1] [operator +] [number 2], [def y]; }");
MT("destructuring",
"([keyword function]([def a], [[[def b], [def c] ]]) {",
" [keyword let] {[def d], [property foo]: [def c][operator =][number 10], [def x]} [operator =] [variable foo]([variable-2 a]);",
" [[[variable-2 c], [variable y] ]] [operator =] [variable-2 c];",
"})();");
MT("destructure_trailing_comma",
"[keyword let] {[def a], [def b],} [operator =] [variable foo];",
"[keyword let] [def c];"); // Parser still in good state?
MT("class_body",
"[keyword class] [def Foo] {",
" [property constructor]() {}",
" [property sayName]() {",
" [keyword return] [string-2 `foo${][variable foo][string-2 }oo`];",
" }",
"}");
MT("class",
"[keyword class] [def Point] [keyword extends] [variable SuperThing] {",
" [keyword get] [property prop]() { [keyword return] [number 24]; }",
" [property constructor]([def x], [def y]) {",
" [keyword super]([string 'something']);",
" [keyword this].[property x] [operator =] [variable-2 x];",
" }",
"}");
MT("anonymous_class_expression",
"[keyword const] [def Adder] [operator =] [keyword class] [keyword extends] [variable Arithmetic] {",
" [property add]([def a], [def b]) {}",
"};");
MT("named_class_expression",
"[keyword const] [def Subber] [operator =] [keyword class] [def Subtract] {",
" [property sub]([def a], [def b]) {}",
"};");
MT("class_async_method",
"[keyword class] [def Foo] {",
" [property sayName1]() {}",
" [keyword async] [property sayName2]() {}",
"}");
MT("import",
"[keyword function] [def foo]() {",
" [keyword import] [def $] [keyword from] [string 'jquery'];",
" [keyword import] { [def encrypt], [def decrypt] } [keyword from] [string 'crypto'];",
"}");
MT("import_trailing_comma",
"[keyword import] {[def foo], [def bar],} [keyword from] [string 'baz']")
MT("import_dynamic",
"[keyword import]([string 'baz']).[property then]")
MT("import_dynamic",
"[keyword const] [def t] [operator =] [keyword import]([string 'baz']).[property then]")
MT("const",
"[keyword function] [def f]() {",
" [keyword const] [[ [def a], [def b] ]] [operator =] [[ [number 1], [number 2] ]];",
"}");
MT("for/of",
"[keyword for]([keyword let] [def of] [keyword of] [variable something]) {}");
MT("for await",
"[keyword for] [keyword await]([keyword let] [def of] [keyword of] [variable something]) {}");
MT("generator",
"[keyword function*] [def repeat]([def n]) {",
" [keyword for]([keyword var] [def i] [operator =] [number 0]; [variable-2 i] [operator <] [variable-2 n]; [operator ++][variable-2 i])",
" [keyword yield] [variable-2 i];",
"}");
MT("let_scoping",
"[keyword function] [def scoped]([def n]) {",
" { [keyword var] [def i]; } [variable-2 i];",
" { [keyword let] [def j]; [variable-2 j]; } [variable j];",
" [keyword if] ([atom true]) { [keyword const] [def k]; [variable-2 k]; } [variable k];",
"}");
MT("switch_scoping",
"[keyword switch] ([variable x]) {",
" [keyword default]:",
" [keyword let] [def j];",
" [keyword return] [variable-2 j]",
"}",
"[variable j];")
MT("leaving_scope",
"[keyword function] [def a]() {",
" {",
" [keyword const] [def x] [operator =] [number 1]",
" [keyword if] ([atom true]) {",
" [keyword let] [def y] [operator =] [number 2]",
" [keyword var] [def z] [operator =] [number 3]",
" [variable console].[property log]([variable-2 x], [variable-2 y], [variable-2 z])",
" }",
" [variable console].[property log]([variable-2 x], [variable y], [variable-2 z])",
" }",
" [variable console].[property log]([variable x], [variable y], [variable-2 z])",
"}")
MT("quotedStringAddition",
"[keyword let] [def f] [operator =] [variable a] [operator +] [string 'fatarrow'] [operator +] [variable c];");
MT("quotedFatArrow",
"[keyword let] [def f] [operator =] [variable a] [operator +] [string '=>'] [operator +] [variable c];");
MT("fatArrow",
"[variable array].[property filter]([def a] [operator =>] [variable-2 a] [operator +] [number 1]);",
"[variable a];", // No longer in scope
"[keyword let] [def f] [operator =] ([[ [def a], [def b] ]], [def c]) [operator =>] [variable-2 a] [operator +] [variable-2 c];",
"[variable c];");
MT("spread",
"[keyword function] [def f]([def a], [meta ...][def b]) {",
" [variable something]([variable-2 a], [meta ...][variable-2 b]);",
"}");
MT("quasi",
"[variable re][string-2 `fofdlakj${][variable x] [operator +] ([variable re][string-2 `foo`]) [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]");
MT("quasi_no_function",
"[variable x] [operator =] [string-2 `fofdlakj${][variable x] [operator +] [string-2 `foo`] [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]");
MT("indent_statement",
"[keyword var] [def x] [operator =] [number 10]",
"[variable x] [operator +=] [variable y] [operator +]",
" [atom Infinity]",
"[keyword debugger];");
MT("indent_if",
"[keyword if] ([number 1])",
" [keyword break];",
"[keyword else] [keyword if] ([number 2])",
" [keyword continue];",
"[keyword else]",
" [number 10];",
"[keyword if] ([number 1]) {",
" [keyword break];",
"} [keyword else] [keyword if] ([number 2]) {",
" [keyword continue];",
"} [keyword else] {",
" [number 10];",
"}");
MT("indent_for",
"[keyword for] ([keyword var] [def i] [operator =] [number 0];",
" [variable i] [operator <] [number 100];",
" [variable i][operator ++])",
" [variable doSomething]([variable i]);",
"[keyword debugger];");
MT("indent_c_style",
"[keyword function] [def foo]()",
"{",
" [keyword debugger];",
"}");
MT("indent_else",
"[keyword for] (;;)",
" [keyword if] ([variable foo])",
" [keyword if] ([variable bar])",
" [number 1];",
" [keyword else]",
" [number 2];",
" [keyword else]",
" [number 3];");
MT("indent_funarg",
"[variable foo]([number 10000],",
" [keyword function]([def a]) {",
" [keyword debugger];",
"};");
MT("indent_below_if",
"[keyword for] (;;)",
" [keyword if] ([variable foo])",
" [number 1];",
"[number 2];");
MT("indent_semicolonless_if",
"[keyword function] [def foo]() {",
" [keyword if] ([variable x])",
" [variable foo]()",
"}")
MT("indent_semicolonless_if_with_statement",
"[keyword function] [def foo]() {",
" [keyword if] ([variable x])",
" [variable foo]()",
" [variable bar]()",
"}")
MT("multilinestring",
"[keyword var] [def x] [operator =] [string 'foo\\]",
"[string bar'];");
MT("scary_regexp",
"[string-2 /foo[[/]]bar/];");
MT("indent_strange_array",
"[keyword var] [def x] [operator =] [[",
" [number 1],,",
" [number 2],",
"]];",
"[number 10];");
MT("param_default",
"[keyword function] [def foo]([def x] [operator =] [string-2 `foo${][number 10][string-2 }bar`]) {",
" [keyword return] [variable-2 x];",
"}");
MT(
"param_destructuring",
"[keyword function] [def foo]([def x] [operator =] [string-2 `foo${][number 10][string-2 }bar`]) {",
" [keyword return] [variable-2 x];",
"}");
MT("new_target",
"[keyword function] [def F]([def target]) {",
" [keyword if] ([variable-2 target] [operator &&] [keyword new].[keyword target].[property name]) {",
" [keyword return] [keyword new]",
" .[keyword target];",
" }",
"}");
MT("async",
"[keyword async] [keyword function] [def foo]([def args]) { [keyword return] [atom true]; }");
MT("async_assignment",
"[keyword const] [def foo] [operator =] [keyword async] [keyword function] ([def args]) { [keyword return] [atom true]; };");
MT("async_object",
"[keyword let] [def obj] [operator =] { [property async]: [atom false] };");
// async be highlighet as keyword and foo as def, but it requires potentially expensive look-ahead. See #4173
MT("async_object_function",
"[keyword let] [def obj] [operator =] { [property async] [property foo]([def args]) { [keyword return] [atom true]; } };");
MT("async_object_properties",
"[keyword let] [def obj] [operator =] {",
" [property prop1]: [keyword async] [keyword function] ([def args]) { [keyword return] [atom true]; },",
" [property prop2]: [keyword async] [keyword function] ([def args]) { [keyword return] [atom true]; },",
" [property prop3]: [keyword async] [keyword function] [def prop3]([def args]) { [keyword return] [atom true]; },",
"};");
MT("async_arrow",
"[keyword const] [def foo] [operator =] [keyword async] ([def args]) [operator =>] { [keyword return] [atom true]; };");
MT("async_jquery",
"[variable $].[property ajax]({",
" [property url]: [variable url],",
" [property async]: [atom true],",
" [property method]: [string 'GET']",
"});");
MT("async_variable",
"[keyword const] [def async] [operator =] {[property a]: [number 1]};",
"[keyword const] [def foo] [operator =] [string-2 `bar ${][variable async].[property a][string-2 }`];")
MT("bigint", "[number 1n] [operator +] [number 0x1afn] [operator +] [number 0o064n] [operator +] [number 0b100n];")
MT("async_comment",
"[keyword async] [comment /**/] [keyword function] [def foo]([def args]) { [keyword return] [atom true]; }");
MT("indent_switch",
"[keyword switch] ([variable x]) {",
" [keyword default]:",
" [keyword return] [number 2]",
"}")
MT("regexp_corner_case",
"[operator +]{} [operator /] [atom undefined];",
"[[[meta ...][string-2 /\\//] ]];",
"[keyword void] [string-2 /\\//];",
"[keyword do] [string-2 /\\//]; [keyword while] ([number 0]);",
"[keyword if] ([number 0]) {} [keyword else] [string-2 /\\//];",
"[string-2 `${][variable async][operator ++][string-2 }//`];",
"[string-2 `${]{} [operator /] [string-2 /\\//}`];")
MT("return_eol",
"[keyword return]",
"{} [string-2 /5/]")
var ts_mode = CodeMirror.getMode({indentUnit: 2}, "application/typescript")
function TS(name) {
test.mode(name, ts_mode, Array.prototype.slice.call(arguments, 1))
}
TS("typescript_extend_type",
"[keyword class] [def Foo] [keyword extends] [type Some][operator <][type Type][operator >] {}")
TS("typescript_arrow_type",
"[keyword let] [def x]: ([variable arg]: [type Type]) [operator =>] [type ReturnType]")
TS("typescript_class",
"[keyword class] [def Foo] {",
" [keyword public] [keyword static] [property main]() {}",
" [keyword private] [property _foo]: [type string];",
"}")
TS("typescript_literal_types",
"[keyword import] [keyword *] [keyword as] [def Sequelize] [keyword from] [string 'sequelize'];",
"[keyword interface] [def MyAttributes] {",
" [property truthy]: [string 'true'] [operator |] [number 1] [operator |] [atom true];",
" [property falsy]: [string 'false'] [operator |] [number 0] [operator |] [atom false];",
"}",
"[keyword interface] [def MyInstance] [keyword extends] [type Sequelize].[type Instance] [operator <] [type MyAttributes] [operator >] {",
" [property rawAttributes]: [type MyAttributes];",
" [property truthy]: [string 'true'] [operator |] [number 1] [operator |] [atom true];",
" [property falsy]: [string 'false'] [operator |] [number 0] [operator |] [atom false];",
"}")
TS("typescript_extend_operators",
"[keyword export] [keyword interface] [def UserModel] [keyword extends]",
" [type Sequelize].[type Model] [operator <] [type UserInstance], [type UserAttributes] [operator >] {",
" [property findById]: (",
" [variable userId]: [type number]",
" ) [operator =>] [type Promise] [operator <] [type Array] [operator <] { [property id], [property name] } [operator >>];",
" [property updateById]: (",
" [variable userId]: [type number],",
" [variable isActive]: [type boolean]",
" ) [operator =>] [type Promise] [operator <] [type AccountHolderNotificationPreferenceInstance] [operator >];",
" }")
TS("typescript_interface_with_const",
"[keyword const] [def hello]: {",
" [property prop1][operator ?]: [type string];",
" [property prop2][operator ?]: [type string];",
"} [operator =] {};")
TS("typescript_double_extend",
"[keyword export] [keyword interface] [def UserAttributes] {",
" [property id][operator ?]: [type number];",
" [property createdAt][operator ?]: [type Date];",
"}",
"[keyword export] [keyword interface] [def UserInstance] [keyword extends] [type Sequelize].[type Instance][operator <][type UserAttributes][operator >], [type UserAttributes] {",
" [property id]: [type number];",
" [property createdAt]: [type Date];",
"}");
TS("typescript_index_signature",
"[keyword interface] [def A] {",
" [[ [variable prop]: [type string] ]]: [type any];",
" [property prop1]: [type any];",
"}");
TS("typescript_generic_class",
"[keyword class] [def Foo][operator <][type T][operator >] {",
" [property bar]() {}",
" [property foo](): [type Foo] {}",
"}")
TS("typescript_type_when_keyword",
"[keyword export] [keyword type] [type AB] [operator =] [type A] [operator |] [type B];",
"[keyword type] [type Flags] [operator =] {",
" [property p1]: [type string];",
" [property p2]: [type boolean];",
"};")
TS("typescript_type_when_not_keyword",
"[keyword class] [def HasType] {",
" [property type]: [type string];",
" [property constructor]([def type]: [type string]) {",
" [keyword this].[property type] [operator =] [variable-2 type];",
" }",
" [property setType]({ [def type] }: { [property type]: [type string]; }) {",
" [keyword this].[property type] [operator =] [variable-2 type];",
" }",
"}")
TS("typescript_function_generics",
"[keyword function] [def a]() {}",
"[keyword function] [def b][operator <][type IA] [keyword extends] [type object], [type IB] [keyword extends] [type object][operator >]() {}",
"[keyword function] [def c]() {}")
TS("typescript_complex_return_type",
"[keyword function] [def A]() {",
" [keyword return] [keyword this].[property property];",
"}",
"[keyword function] [def B](): [type Promise][operator <]{ [[ [variable key]: [type string] ]]: [type any] } [operator |] [atom null][operator >] {",
" [keyword return] [keyword this].[property property];",
"}")
TS("typescript_complex_type_casting",
"[keyword const] [def giftpay] [operator =] [variable config].[property get]([string 'giftpay']) [keyword as] { [[ [variable platformUuid]: [type string] ]]: { [property version]: [type number]; [property apiCode]: [type string]; } };")
TS("typescript_keyof",
"[keyword function] [def x][operator <][type T] [keyword extends] [keyword keyof] [type X][operator >]([def a]: [type T]) {",
" [keyword return]")
TS("typescript_new_typeargs",
"[keyword let] [def x] [operator =] [keyword new] [variable Map][operator <][type string], [type Date][operator >]([string-2 `foo${][variable bar][string-2 }`])")
TS("modifiers",
"[keyword class] [def Foo] {",
" [keyword public] [keyword abstract] [property bar]() {}",
" [property constructor]([keyword readonly] [keyword private] [def x]) {}",
"}")
TS("arrow prop",
"({[property a]: [def p] [operator =>] [variable-2 p]})")
TS("generic in function call",
"[keyword this].[property a][operator <][type Type][operator >]([variable foo]);",
"[keyword this].[property a][operator <][variable Type][operator >][variable foo];")
TS("type guard",
"[keyword class] [def Appler] {",
" [keyword static] [property assertApple]([def fruit]: [type Fruit]): [variable-2 fruit] [keyword is] [type Apple] {",
" [keyword if] ([operator !]([variable-2 fruit] [keyword instanceof] [variable Apple]))",
" [keyword throw] [keyword new] [variable Error]();",
" }",
"}")
TS("type as variable",
"[variable type] [operator =] [variable x] [keyword as] [type Bar];");
TS("enum body",
"[keyword export] [keyword const] [keyword enum] [def CodeInspectionResultType] {",
" [def ERROR] [operator =] [string 'problem_type_error'],",
" [def WARNING] [operator =] [string 'problem_type_warning'],",
" [def META],",
"}")
TS("parenthesized type",
"[keyword class] [def Foo] {",
" [property x] [operator =] [keyword new] [variable A][operator <][type B], [type string][operator |](() [operator =>] [type void])[operator >]();",
" [keyword private] [property bar]();",
"}")
TS("abstract class",
"[keyword export] [keyword abstract] [keyword class] [def Foo] {}")
TS("interface without semicolons",
"[keyword interface] [def Foo] {",
" [property greet]([def x]: [type int]): [type blah]",
" [property bar]: [type void]",
"}")
var jsonld_mode = CodeMirror.getMode(
{indentUnit: 2},
{name: "javascript", jsonld: true}
);
function LD(name) {
test.mode(name, jsonld_mode, Array.prototype.slice.call(arguments, 1));
}
LD("json_ld_keywords",
'{',
' [meta "@context"]: {',
' [meta "@base"]: [string "http://example.com"],',
' [meta "@vocab"]: [string "http://xmlns.com/foaf/0.1/"],',
' [property "likesFlavor"]: {',
' [meta "@container"]: [meta "@list"]',
' [meta "@reverse"]: [string "@beFavoriteOf"]',
' },',
' [property "nick"]: { [meta "@container"]: [meta "@set"] },',
' [property "nick"]: { [meta "@container"]: [meta "@index"] }',
' },',
' [meta "@graph"]: [[ {',
' [meta "@id"]: [string "http://dbpedia.org/resource/John_Lennon"],',
' [property "name"]: [string "John Lennon"],',
' [property "modified"]: {',
' [meta "@value"]: [string "2010-05-29T14:17:39+02:00"],',
' [meta "@type"]: [string "http://www.w3.org/2001/XMLSchema#dateTime"]',
' }',
' } ]]',
'}');
LD("json_ld_fake",
'{',
' [property "@fake"]: [string "@fake"],',
' [property "@contextual"]: [string "@identifier"],',
' [property "user@domain.com"]: [string "@graphical"],',
' [property "@ID"]: [string "@@ID"]',
'}');
})();
-62
View File
@@ -1,62 +0,0 @@
<!doctype html>
<title>CodeMirror: TypeScript mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">
<link rel="stylesheet" href="../../lib/codemirror.css">
<script src="../../lib/codemirror.js"></script>
<script src="../../addon/edit/matchbrackets.js"></script>
<script src="javascript.js"></script>
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
<div id=nav>
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
<ul>
<li><a href="../../index.html">Home</a>
<li><a href="../../doc/manual.html">Manual</a>
<li><a href="https://github.com/codemirror/codemirror">Code</a>
</ul>
<ul>
<li><a href="../index.html">Language modes</a>
<li><a class=active href="#">TypeScript</a>
</ul>
</div>
<article>
<h2>TypeScript mode</h2>
<div><textarea id="code" name="code">
class Greeter {
greeting: string;
constructor (message: string) {
this.greeting = message;
}
greet() {
return "Hello, " + this.greeting;
}
}
var greeter = new Greeter("world");
var button = document.createElement('button')
button.innerText = "Say Hello"
button.onclick = function() {
alert(greeter.greet())
}
document.body.appendChild(button)
</textarea></div>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
matchBrackets: true,
mode: "text/typescript"
});
</script>
<p>This is a specialization of the <a href="index.html">JavaScript mode</a>.</p>
</article>
-402
View File
@@ -1,402 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
var htmlConfig = {
autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
'track': true, 'wbr': true, 'menuitem': true},
implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
'th': true, 'tr': true},
contextGrabbers: {
'dd': {'dd': true, 'dt': true},
'dt': {'dd': true, 'dt': true},
'li': {'li': true},
'option': {'option': true, 'optgroup': true},
'optgroup': {'optgroup': true},
'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
'rp': {'rp': true, 'rt': true},
'rt': {'rp': true, 'rt': true},
'tbody': {'tbody': true, 'tfoot': true},
'td': {'td': true, 'th': true},
'tfoot': {'tbody': true},
'th': {'td': true, 'th': true},
'thead': {'tbody': true, 'tfoot': true},
'tr': {'tr': true}
},
doNotIndent: {"pre": true},
allowUnquoted: true,
allowMissing: true,
caseFold: true
}
var xmlConfig = {
autoSelfClosers: {},
implicitlyClosed: {},
contextGrabbers: {},
doNotIndent: {},
allowUnquoted: false,
allowMissing: false,
allowMissingTagName: false,
caseFold: false
}
CodeMirror.defineMode("xml", function(editorConf, config_) {
var indentUnit = editorConf.indentUnit
var config = {}
var defaults = config_.htmlMode ? htmlConfig : xmlConfig
for (var prop in defaults) config[prop] = defaults[prop]
for (var prop in config_) config[prop] = config_[prop]
// Return variables for tokenizers
var type, setStyle;
function inText(stream, state) {
function chain(parser) {
state.tokenize = parser;
return parser(stream, state);
}
var ch = stream.next();
if (ch == "<") {
if (stream.eat("!")) {
if (stream.eat("[")) {
if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>"));
else return null;
} else if (stream.match("--")) {
return chain(inBlock("comment", "-->"));
} else if (stream.match("DOCTYPE", true, true)) {
stream.eatWhile(/[\w\._\-]/);
return chain(doctype(1));
} else {
return null;
}
} else if (stream.eat("?")) {
stream.eatWhile(/[\w\._\-]/);
state.tokenize = inBlock("meta", "?>");
return "meta";
} else {
type = stream.eat("/") ? "closeTag" : "openTag";
state.tokenize = inTag;
return "tag bracket";
}
} else if (ch == "&") {
var ok;
if (stream.eat("#")) {
if (stream.eat("x")) {
ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";");
} else {
ok = stream.eatWhile(/[\d]/) && stream.eat(";");
}
} else {
ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";");
}
return ok ? "atom" : "error";
} else {
stream.eatWhile(/[^&<]/);
return null;
}
}
inText.isInText = true;
function inTag(stream, state) {
var ch = stream.next();
if (ch == ">" || (ch == "/" && stream.eat(">"))) {
state.tokenize = inText;
type = ch == ">" ? "endTag" : "selfcloseTag";
return "tag bracket";
} else if (ch == "=") {
type = "equals";
return null;
} else if (ch == "<") {
state.tokenize = inText;
state.state = baseState;
state.tagName = state.tagStart = null;
var next = state.tokenize(stream, state);
return next ? next + " tag error" : "tag error";
} else if (/[\'\"]/.test(ch)) {
state.tokenize = inAttribute(ch);
state.stringStartCol = stream.column();
return state.tokenize(stream, state);
} else {
stream.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);
return "word";
}
}
function inAttribute(quote) {
var closure = function(stream, state) {
while (!stream.eol()) {
if (stream.next() == quote) {
state.tokenize = inTag;
break;
}
}
return "string";
};
closure.isInAttribute = true;
return closure;
}
function inBlock(style, terminator) {
return function(stream, state) {
while (!stream.eol()) {
if (stream.match(terminator)) {
state.tokenize = inText;
break;
}
stream.next();
}
return style;
}
}
function doctype(depth) {
return function(stream, state) {
var ch;
while ((ch = stream.next()) != null) {
if (ch == "<") {
state.tokenize = doctype(depth + 1);
return state.tokenize(stream, state);
} else if (ch == ">") {
if (depth == 1) {
state.tokenize = inText;
break;
} else {
state.tokenize = doctype(depth - 1);
return state.tokenize(stream, state);
}
}
}
return "meta";
};
}
function Context(state, tagName, startOfLine) {
this.prev = state.context;
this.tagName = tagName;
this.indent = state.indented;
this.startOfLine = startOfLine;
if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))
this.noIndent = true;
}
function popContext(state) {
if (state.context) state.context = state.context.prev;
}
function maybePopContext(state, nextTagName) {
var parentTagName;
while (true) {
if (!state.context) {
return;
}
parentTagName = state.context.tagName;
if (!config.contextGrabbers.hasOwnProperty(parentTagName) ||
!config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
return;
}
popContext(state);
}
}
function baseState(type, stream, state) {
if (type == "openTag") {
state.tagStart = stream.column();
return tagNameState;
} else if (type == "closeTag") {
return closeTagNameState;
} else {
return baseState;
}
}
function tagNameState(type, stream, state) {
if (type == "word") {
state.tagName = stream.current();
setStyle = "tag";
return attrState;
} else if (config.allowMissingTagName && type == "endTag") {
setStyle = "tag bracket";
return attrState(type, stream, state);
} else {
setStyle = "error";
return tagNameState;
}
}
function closeTagNameState(type, stream, state) {
if (type == "word") {
var tagName = stream.current();
if (state.context && state.context.tagName != tagName &&
config.implicitlyClosed.hasOwnProperty(state.context.tagName))
popContext(state);
if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {
setStyle = "tag";
return closeState;
} else {
setStyle = "tag error";
return closeStateErr;
}
} else if (config.allowMissingTagName && type == "endTag") {
setStyle = "tag bracket";
return closeState(type, stream, state);
} else {
setStyle = "error";
return closeStateErr;
}
}
function closeState(type, _stream, state) {
if (type != "endTag") {
setStyle = "error";
return closeState;
}
popContext(state);
return baseState;
}
function closeStateErr(type, stream, state) {
setStyle = "error";
return closeState(type, stream, state);
}
function attrState(type, _stream, state) {
if (type == "word") {
setStyle = "attribute";
return attrEqState;
} else if (type == "endTag" || type == "selfcloseTag") {
var tagName = state.tagName, tagStart = state.tagStart;
state.tagName = state.tagStart = null;
if (type == "selfcloseTag" ||
config.autoSelfClosers.hasOwnProperty(tagName)) {
maybePopContext(state, tagName);
} else {
maybePopContext(state, tagName);
state.context = new Context(state, tagName, tagStart == state.indented);
}
return baseState;
}
setStyle = "error";
return attrState;
}
function attrEqState(type, stream, state) {
if (type == "equals") return attrValueState;
if (!config.allowMissing) setStyle = "error";
return attrState(type, stream, state);
}
function attrValueState(type, stream, state) {
if (type == "string") return attrContinuedState;
if (type == "word" && config.allowUnquoted) {setStyle = "string"; return attrState;}
setStyle = "error";
return attrState(type, stream, state);
}
function attrContinuedState(type, stream, state) {
if (type == "string") return attrContinuedState;
return attrState(type, stream, state);
}
return {
startState: function(baseIndent) {
var state = {tokenize: inText,
state: baseState,
indented: baseIndent || 0,
tagName: null, tagStart: null,
context: null}
if (baseIndent != null) state.baseIndent = baseIndent
return state
},
token: function(stream, state) {
if (!state.tagName && stream.sol())
state.indented = stream.indentation();
if (stream.eatSpace()) return null;
type = null;
var style = state.tokenize(stream, state);
if ((style || type) && style != "comment") {
setStyle = null;
state.state = state.state(type || style, stream, state);
if (setStyle)
style = setStyle == "error" ? style + " error" : setStyle;
}
return style;
},
indent: function(state, textAfter, fullLine) {
var context = state.context;
// Indent multi-line strings (e.g. css).
if (state.tokenize.isInAttribute) {
if (state.tagStart == state.indented)
return state.stringStartCol + 1;
else
return state.indented + indentUnit;
}
if (context && context.noIndent) return CodeMirror.Pass;
if (state.tokenize != inTag && state.tokenize != inText)
return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
// Indent the starts of attribute names.
if (state.tagName) {
if (config.multilineTagIndentPastTag !== false)
return state.tagStart + state.tagName.length + 2;
else
return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1);
}
if (config.alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
var tagAfter = textAfter && /^<(\/)?([\w_:\.-]*)/.exec(textAfter);
if (tagAfter && tagAfter[1]) { // Closing tag spotted
while (context) {
if (context.tagName == tagAfter[2]) {
context = context.prev;
break;
} else if (config.implicitlyClosed.hasOwnProperty(context.tagName)) {
context = context.prev;
} else {
break;
}
}
} else if (tagAfter) { // Opening tag spotted
while (context) {
var grabbers = config.contextGrabbers[context.tagName];
if (grabbers && grabbers.hasOwnProperty(tagAfter[2]))
context = context.prev;
else
break;
}
}
while (context && context.prev && !context.startOfLine)
context = context.prev;
if (context) return context.indent + indentUnit;
else return state.baseIndent || 0;
},
electricInput: /<\/[\s\w:]+>$/,
blockCommentStart: "<!--",
blockCommentEnd: "-->",
configuration: config.htmlMode ? "html" : "xml",
helperType: config.htmlMode ? "html" : "xml",
skipAttribute: function(state) {
if (state.state == attrValueState)
state.state = attrState
}
};
});
CodeMirror.defineMIME("text/xml", "xml");
CodeMirror.defineMIME("application/xml", "xml");
if (!CodeMirror.mimeModes.hasOwnProperty("text/html"))
CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true});
});
-84
View File
@@ -1,84 +0,0 @@
#!/usr/bin/env python
"""
Module docstring.
"""
import sys, os, optparse
items = (
"jquery.js",
# "jspolygon.js",
"optimal-select.js",
"hammer.js",
"hammer.propagating.js",
"d3/d3.js",
"d3/d3-selection-multi.js",
"highlight",
"pixi/pixi.js",
"pixi/lib/crn_decomp.js",
"pixi/pixi-compressed-textures.js",
"pixi/pixi-filters.js",
"pixi/pixi-particles.js",
"pixi/pixi-projection.js",
"greensock/src/uncompressed",
"greensock/src/uncompressed/easing",
"greensock/src/uncompressed/plugins",
"greensock/src/uncompressed/utils",
"convertPointFromPageToNode.js"
# "getRelativeURL.js"
)
def process_command_line(argv):
"""
Return a 2-tuple: (settings object, args list).
`argv` is a list of arguments, or `None` for ``sys.argv[1:]``.
"""
if argv is None:
argv = sys.argv[1:]
# initialize the parser object:
parser = optparse.OptionParser(
formatter=optparse.TitledHelpFormatter(width=78),
add_help_option=None)
# define options here:
parser.add_option( # customized description; put --help last
'-h', '--help', action='help',
help='Show this help message and exit.')
settings, args = parser.parse_args(argv)
# check number of arguments, verify values, etc.:
if args:
parser.error('program takes no command-line arguments; '
'"%s" ignored.' % (args,))
# further process settings & args if necessary
return settings, args
def main(argv=None):
settings, args = process_command_line(argv)
run(settings, args)
return 0 # success
def run(settings, args):
with open("all.js", 'w') as outfile:
for item in items:
if item.endswith(".js"):
appendFile(outfile, item)
else:
for filename in os.listdir(item):
if filename.endswith(".js"):
appendFile(outfile, os.path.join(item, filename))
def appendFile(outfile, filename):
with open(filename) as infile:
outfile.write("\n")
outfile.write(infile.read())
print("File appended: " + infile.name)
if __name__ == '__main__':
status = main()
sys.exit(status)
-68
View File
@@ -1,68 +0,0 @@
#!/usr/bin/env python
"""
Module docstring.
"""
import sys, os, optparse
items = (
"highlight",
"greensock/src/uncompressed/plugins",
"greensock/src/uncompressed/TweenLite.js",
"convertPointFromPageToNode.js"
)
def process_command_line(argv):
"""
Return a 2-tuple: (settings object, args list).
`argv` is a list of arguments, or `None` for ``sys.argv[1:]``.
"""
if argv is None:
argv = sys.argv[1:]
# initialize the parser object:
parser = optparse.OptionParser(
formatter=optparse.TitledHelpFormatter(width=78),
add_help_option=None)
# define options here:
parser.add_option( # customized description; put --help last
'-h', '--help', action='help',
help='Show this help message and exit.')
settings, args = parser.parse_args(argv)
# check number of arguments, verify values, etc.:
if args:
parser.error('program takes no command-line arguments; '
'"%s" ignored.' % (args,))
# further process settings & args if necessary
return settings, args
def main(argv=None):
settings, args = process_command_line(argv)
run(settings, args)
return 0 # success
def run(settings, args):
with open("preload.js", 'w') as outfile:
for item in items:
if item.endswith(".js"):
appendFile(outfile, item)
else:
for filename in os.listdir(item):
if filename.endswith(".js"):
appendFile(outfile, os.path.join(item, filename))
def appendFile(outfile, filename):
with open(filename) as infile:
outfile.write("\n")
outfile.write(infile.read())
print("File appended: " + infile.name)
if __name__ == '__main__':
status = main()
sys.exit(status)
-94
View File
@@ -1,94 +0,0 @@
// https://github.com/d3/d3-selection-multi Version 1.0.1. Copyright 2017 Mike Bostock.
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('d3-selection'), require('d3-transition')) :
typeof define === 'function' && define.amd ? define(['d3-selection', 'd3-transition'], factory) :
(factory(global.d3,global.d3));
}(this, (function (d3Selection,d3Transition) { 'use strict';
function attrsFunction(selection$$1, map) {
return selection$$1.each(function() {
var x = map.apply(this, arguments), s = d3Selection.select(this);
for (var name in x) s.attr(name, x[name]);
});
}
function attrsObject(selection$$1, map) {
for (var name in map) selection$$1.attr(name, map[name]);
return selection$$1;
}
var selection_attrs = function(map) {
return (typeof map === "function" ? attrsFunction : attrsObject)(this, map);
};
function stylesFunction(selection$$1, map, priority) {
return selection$$1.each(function() {
var x = map.apply(this, arguments), s = d3Selection.select(this);
for (var name in x) s.style(name, x[name], priority);
});
}
function stylesObject(selection$$1, map, priority) {
for (var name in map) selection$$1.style(name, map[name], priority);
return selection$$1;
}
var selection_styles = function(map, priority) {
return (typeof map === "function" ? stylesFunction : stylesObject)(this, map, priority == null ? "" : priority);
};
function propertiesFunction(selection$$1, map) {
return selection$$1.each(function() {
var x = map.apply(this, arguments), s = d3Selection.select(this);
for (var name in x) s.property(name, x[name]);
});
}
function propertiesObject(selection$$1, map) {
for (var name in map) selection$$1.property(name, map[name]);
return selection$$1;
}
var selection_properties = function(map) {
return (typeof map === "function" ? propertiesFunction : propertiesObject)(this, map);
};
function attrsFunction$1(transition$$1, map) {
return transition$$1.each(function() {
var x = map.apply(this, arguments), t = d3Selection.select(this).transition(transition$$1);
for (var name in x) t.attr(name, x[name]);
});
}
function attrsObject$1(transition$$1, map) {
for (var name in map) transition$$1.attr(name, map[name]);
return transition$$1;
}
var transition_attrs = function(map) {
return (typeof map === "function" ? attrsFunction$1 : attrsObject$1)(this, map);
};
function stylesFunction$1(transition$$1, map, priority) {
return transition$$1.each(function() {
var x = map.apply(this, arguments), t = d3Selection.select(this).transition(transition$$1);
for (var name in x) t.style(name, x[name], priority);
});
}
function stylesObject$1(transition$$1, map, priority) {
for (var name in map) transition$$1.style(name, map[name], priority);
return transition$$1;
}
var transition_styles = function(map, priority) {
return (typeof map === "function" ? stylesFunction$1 : stylesObject$1)(this, map, priority == null ? "" : priority);
};
d3Selection.selection.prototype.attrs = selection_attrs;
d3Selection.selection.prototype.styles = selection_styles;
d3Selection.selection.prototype.properties = selection_properties;
d3Transition.transition.prototype.attrs = transition_attrs;
d3Transition.transition.prototype.styles = transition_styles;
})));
-2
View File
@@ -1,2 +0,0 @@
// https://github.com/d3/d3-selection-multi Version 1.0.1. Copyright 2017 Mike Bostock.
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(require("d3-selection"),require("d3-transition")):"function"==typeof define&&define.amd?define(["d3-selection","d3-transition"],n):n(t.d3,t.d3)}(this,function(t,n){"use strict";function r(n,r){return n.each(function(){var n=r.apply(this,arguments),e=t.select(this);for(var i in n)e.attr(i,n[i])})}function e(t,n){for(var r in n)t.attr(r,n[r]);return t}function i(n,r,e){return n.each(function(){var n=r.apply(this,arguments),i=t.select(this);for(var o in n)i.style(o,n[o],e)})}function o(t,n,r){for(var e in n)t.style(e,n[e],r);return t}function f(n,r){return n.each(function(){var n=r.apply(this,arguments),e=t.select(this);for(var i in n)e.property(i,n[i])})}function u(t,n){for(var r in n)t.property(r,n[r]);return t}function s(n,r){return n.each(function(){var e=r.apply(this,arguments),i=t.select(this).transition(n);for(var o in e)i.attr(o,e[o])})}function c(t,n){for(var r in n)t.attr(r,n[r]);return t}function a(n,r,e){return n.each(function(){var i=r.apply(this,arguments),o=t.select(this).transition(n);for(var f in i)o.style(f,i[f],e)})}function p(t,n,r){for(var e in n)t.style(e,n[e],r);return t}var l=function(t){return("function"==typeof t?r:e)(this,t)},y=function(t,n){return("function"==typeof t?i:o)(this,t,null==n?"":n)},h=function(t){return("function"==typeof t?f:u)(this,t)},v=function(t){return("function"==typeof t?s:c)(this,t)},d=function(t,n){return("function"==typeof t?a:p)(this,t,null==n?"":n)};t.selection.prototype.attrs=l,t.selection.prototype.styles=y,t.selection.prototype.properties=h,n.transition.prototype.attrs=v,n.transition.prototype.styles=d});
-18293
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
-4511
View File
File diff suppressed because it is too large Load Diff
-1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-2643
View File
File diff suppressed because it is too large Load Diff
-7
View File
File diff suppressed because one or more lines are too long
-1
View File
File diff suppressed because one or more lines are too long
-231
View File
@@ -1,231 +0,0 @@
'use strict';
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], factory);
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory();
} else {
// Browser globals (root is window)
window.propagating = factory();
}
}(function () {
var _firstTarget = null; // singleton, will contain the target element where the touch event started
/**
* Extend an Hammer.js instance with event propagation.
*
* Features:
* - Events emitted by hammer will propagate in order from child to parent
* elements.
* - Events are extended with a function `event.stopPropagation()` to stop
* propagation to parent elements.
* - An option `preventDefault` to stop all default browser behavior.
*
* Usage:
* var hammer = propagatingHammer(new Hammer(element));
* var hammer = propagatingHammer(new Hammer(element), {preventDefault: true});
*
* @param {Hammer.Manager} hammer An hammer instance.
* @param {Object} [options] Available options:
* - `preventDefault: true | false | 'mouse' | 'touch' | 'pen'`.
* Enforce preventing the default browser behavior.
* Cannot be set to `false`.
* @return {Hammer.Manager} Returns the same hammer instance with extended
* functionality
*/
return function propagating(hammer, options) {
var _options = options || {
preventDefault: false
};
if (hammer.Manager) {
// This looks like the Hammer constructor.
// Overload the constructors with our own.
var Hammer = hammer;
var PropagatingHammer = function(element, options) {
var o = Object.create(_options);
if (options) Hammer.assign(o, options);
return propagating(new Hammer(element, o), o);
};
Hammer.assign(PropagatingHammer, Hammer);
PropagatingHammer.Manager = function (element, options) {
var o = Object.create(_options);
if (options) Hammer.assign(o, options);
return propagating(new Hammer.Manager(element, o), o);
};
return PropagatingHammer;
}
// create a wrapper object which will override the functions
// `on`, `off`, `destroy`, and `emit` of the hammer instance
var wrapper = Object.create(hammer);
// attach to DOM element
var element = hammer.element;
if(!element.hammer) element.hammer = [];
element.hammer.push(wrapper);
// register an event to catch the start of a gesture and store the
// target in a singleton
hammer.on('hammer.input', function (event) {
if (_options.preventDefault === true || (_options.preventDefault === event.pointerType)) {
event.preventDefault();
}
if (event.isFirst) {
_firstTarget = event.target;
}
});
/** @type {Object.<String, Array.<function>>} */
wrapper._handlers = {};
/**
* Register a handler for one or multiple events
* @param {String} events A space separated string with events
* @param {function} handler A callback function, called as handler(event)
* @returns {Hammer.Manager} Returns the hammer instance
*/
wrapper.on = function (events, handler) {
// register the handler
split(events).forEach(function (event) {
var _handlers = wrapper._handlers[event];
if (!_handlers) {
wrapper._handlers[event] = _handlers = [];
// register the static, propagated handler
hammer.on(event, propagatedHandler);
}
_handlers.push(handler);
});
return wrapper;
};
/**
* Unregister a handler for one or multiple events
* @param {String} events A space separated string with events
* @param {function} [handler] Optional. The registered handler. If not
* provided, all handlers for given events
* are removed.
* @returns {Hammer.Manager} Returns the hammer instance
*/
wrapper.off = function (events, handler) {
// unregister the handler
split(events).forEach(function (event) {
var _handlers = wrapper._handlers[event];
if (_handlers) {
_handlers = handler ? _handlers.filter(function (h) {
return h !== handler;
}) : [];
if (_handlers.length > 0) {
wrapper._handlers[event] = _handlers;
}
else {
// remove static, propagated handler
hammer.off(event, propagatedHandler);
delete wrapper._handlers[event];
}
}
});
return wrapper;
};
/**
* Emit to the event listeners
* @param {string} eventType
* @param {Event} event
*/
wrapper.emit = function(eventType, event) {
_firstTarget = event.target;
hammer.emit(eventType, event);
};
wrapper.destroy = function () {
// Detach from DOM element
var hammers = hammer.element.hammer;
var idx = hammers.indexOf(wrapper);
if(idx !== -1) hammers.splice(idx,1);
if(!hammers.length) delete hammer.element.hammer;
// clear all handlers
wrapper._handlers = {};
// call original hammer destroy
hammer.destroy();
};
// split a string with space separated words
function split(events) {
return events.match(/[^ ]+/g);
}
/**
* A static event handler, applying event propagation.
* @param {Object} event
*/
function propagatedHandler(event) {
// let only a single hammer instance handle this event
if (event.type !== 'hammer.input') {
// it is possible that the same srcEvent is used with multiple hammer events,
// we keep track on which events are handled in an object _handled
if (!event.srcEvent._handled) {
event.srcEvent._handled = {};
}
if (event.srcEvent._handled[event.type]) {
return;
}
else {
event.srcEvent._handled[event.type] = true;
}
}
// attach a stopPropagation function to the event
var stopped = false;
event.stopPropagation = function () {
stopped = true;
};
//wrap the srcEvent's stopPropagation to also stop hammer propagation:
var srcStop = event.srcEvent.stopPropagation.bind(event.srcEvent);
if(typeof srcStop == "function") {
event.srcEvent.stopPropagation = function(){
srcStop();
event.stopPropagation();
}
}
// attach firstTarget property to the event
event.firstTarget = _firstTarget;
// propagate over all elements (until stopped)
var elem = _firstTarget;
while (elem && !stopped) {
var elemHammer = elem.hammer;
if(elemHammer){
var _handlers;
for(var k = 0; k < elemHammer.length; k++){
_handlers = elemHammer[k]._handlers[event.type];
if(_handlers) for (var i = 0; i < _handlers.length && !stopped; i++) {
_handlers[i](event);
}
}
}
elem = elem.parentNode;
}
}
return wrapper;
};
}));
File diff suppressed because one or more lines are too long
-130
View File
@@ -1,130 +0,0 @@
/*! iNoBounce - v0.1.6
* https://github.com/lazd/iNoBounce/
* Copyright (c) 2013 Larry Davis <lazdnet@gmail.com>; Licensed BSD */
(function(global) {
// Stores the Y position where the touch started
var startY = 0;
// Store enabled status
var enabled = false;
var supportsPassiveOption = false;
try {
var opts = Object.defineProperty({}, 'passive', {
get: function() {
supportsPassiveOption = true;
}
});
window.addEventListener('test', null, opts);
} catch (e) {}
var handleTouchmove = function(evt) {
// Get the element that was scrolled upon
var el = evt.target;
// Check all parent elements for scrollability
while (el !== document.body && el !== document) {
// Get some style properties
var style = window.getComputedStyle(el);
if (!style) {
// If we've encountered an element we can't compute the style for, get out
break;
}
// Ignore range input element
if (el.nodeName === 'INPUT' && el.getAttribute('type') === 'range') {
return;
}
var scrolling = style.getPropertyValue('-webkit-overflow-scrolling');
var overflowY = style.getPropertyValue('overflow-y');
var height = parseInt(style.getPropertyValue('height'), 10);
// Determine if the element should scroll
var isScrollable = scrolling === 'touch' && (overflowY === 'auto' || overflowY === 'scroll');
var canScroll = el.scrollHeight > el.offsetHeight;
if (isScrollable && canScroll) {
// Get the current Y position of the touch
var curY = evt.touches ? evt.touches[0].screenY : evt.screenY;
// Determine if the user is trying to scroll past the top or bottom
// In this case, the window will bounce, so we have to prevent scrolling completely
var isAtTop = (startY <= curY && el.scrollTop === 0);
var isAtBottom = (startY >= curY && el.scrollHeight - el.scrollTop === height);
// Stop a bounce bug when at the bottom or top of the scrollable element
if (isAtTop || isAtBottom) {
evt.preventDefault();
}
// No need to continue up the DOM, we've done our job
return;
}
// Test the next parent
el = el.parentNode;
}
// Stop the bouncing -- no parents are scrollable
evt.preventDefault();
};
var handleTouchstart = function(evt) {
// Store the first Y position of the touch
startY = evt.touches ? evt.touches[0].screenY : evt.screenY;
};
var enable = function() {
// Listen to a couple key touch events
window.addEventListener('touchstart', handleTouchstart, supportsPassiveOption ? { passive : false } : false);
window.addEventListener('touchmove', handleTouchmove, supportsPassiveOption ? { passive : false } : false);
enabled = true;
};
var disable = function() {
// Stop listening
window.removeEventListener('touchstart', handleTouchstart, false);
window.removeEventListener('touchmove', handleTouchmove, false);
enabled = false;
};
var isEnabled = function() {
return enabled;
};
// Enable by default if the browser supports -webkit-overflow-scrolling
// Test this by setting the property with JavaScript on an element that exists in the DOM
// Then, see if the property is reflected in the computed style
var testDiv = document.createElement('div');
document.documentElement.appendChild(testDiv);
testDiv.style.WebkitOverflowScrolling = 'touch';
var scrollSupport = 'getComputedStyle' in window && window.getComputedStyle(testDiv)['-webkit-overflow-scrolling'] === 'touch';
document.documentElement.removeChild(testDiv);
if (scrollSupport) {
enable();
}
// A module to support enabling/disabling iNoBounce
var iNoBounce = {
enable: enable,
disable: disable,
isEnabled: isEnabled
};
if (typeof module !== 'undefined' && module.exports) {
// Node.js Support
module.exports = iNoBounce;
}
if (typeof global.define === 'function') {
// AMD Support
(function(define) {
define('iNoBounce', [], function() { return iNoBounce; });
}(global.define));
}
else {
// Browser support
global.iNoBounce = iNoBounce;
}
}(this));
-1
View File
@@ -1 +0,0 @@
(function(global){var startY=0;var enabled=false;var supportsPassiveOption=false;try{var opts=Object.defineProperty({},"passive",{get:function(){supportsPassiveOption=true}});window.addEventListener("test",null,opts)}catch(e){}var handleTouchmove=function(evt){var el=evt.target;while(el!==document.body&&el!==document){var style=window.getComputedStyle(el);if(!style){break}if(el.nodeName==="INPUT"&&el.getAttribute("type")==="range"){return}var scrolling=style.getPropertyValue("-webkit-overflow-scrolling");var overflowY=style.getPropertyValue("overflow-y");var height=parseInt(style.getPropertyValue("height"),10);var isScrollable=scrolling==="touch"&&(overflowY==="auto"||overflowY==="scroll");var canScroll=el.scrollHeight>el.offsetHeight;if(isScrollable&&canScroll){var curY=evt.touches?evt.touches[0].screenY:evt.screenY;var isAtTop=startY<=curY&&el.scrollTop===0;var isAtBottom=startY>=curY&&el.scrollHeight-el.scrollTop===height;if(isAtTop||isAtBottom){evt.preventDefault()}return}el=el.parentNode}evt.preventDefault()};var handleTouchstart=function(evt){startY=evt.touches?evt.touches[0].screenY:evt.screenY};var enable=function(){window.addEventListener("touchstart",handleTouchstart,supportsPassiveOption?{passive:false}:false);window.addEventListener("touchmove",handleTouchmove,supportsPassiveOption?{passive:false}:false);enabled=true};var disable=function(){window.removeEventListener("touchstart",handleTouchstart,false);window.removeEventListener("touchmove",handleTouchmove,false);enabled=false};var isEnabled=function(){return enabled};var testDiv=document.createElement("div");document.documentElement.appendChild(testDiv);testDiv.style.WebkitOverflowScrolling="touch";var scrollSupport="getComputedStyle"in window&&window.getComputedStyle(testDiv)["-webkit-overflow-scrolling"]==="touch";document.documentElement.removeChild(testDiv);if(scrollSupport){enable()}var iNoBounce={enable:enable,disable:disable,isEnabled:isEnabled};if(typeof module!=="undefined"&&module.exports){module.exports=iNoBounce}if(typeof global.define==="function"){(function(define){define("iNoBounce",[],function(){return iNoBounce})})(global.define)}else{global.iNoBounce=iNoBounce}})(this);
-131
View File
@@ -1,131 +0,0 @@
/*! iNoBounce - v0.1.6
* https://github.com/lazd/iNoBounce/
* Copyright (c) 2013 Larry Davis <lazdnet@gmail.com>; Licensed BSD */
(function(global) {
// Stores the Y position where the touch started
var startY = 0;
// Store enabled status
var enabled = false;
var supportsPassiveOption = false;
try {
var opts = Object.defineProperty({}, 'passive', {
get: function() {
supportsPassiveOption = true;
}
});
window.addEventListener('test', null, opts);
} catch (e) {}
var handleTouchmove = function(evt) {
// Get the element that was scrolled upon
var el = evt.target;
// Check all parent elements for scrollability
while (el !== document.body && el !== document) {
// Get some style properties
var style = window.getComputedStyle(el);
if (!style) {
// If we've encountered an element we can't compute the style for, get out
break;
}
// Ignore range input element
if (el.nodeName === 'INPUT' && el.getAttribute('type') === 'range') {
return;
}
var scrolling = style.getPropertyValue('-webkit-overflow-scrolling');
var overflowY = style.getPropertyValue('overflow-y');
var height = parseInt(style.getPropertyValue('height'), 10);
// Determine if the element should scroll
var isScrollable = scrolling === 'touch' && (overflowY === 'auto' || overflowY === 'scroll');
var canScroll = el.scrollHeight > el.offsetHeight;
if (isScrollable && canScroll) {
// Get the current Y position of the touch
var curY = evt.touches ? evt.touches[0].screenY : evt.screenY;
// Determine if the user is trying to scroll past the top or bottom
// In this case, the window will bounce, so we have to prevent scrolling completely
var isAtTop = (startY <= curY && el.scrollTop === 0);
var isAtBottom = (startY >= curY && el.scrollHeight - el.scrollTop === height);
// Stop a bounce bug when at the bottom or top of the scrollable element
if (isAtTop || isAtBottom) {
evt.preventDefault();
}
// No need to continue up the DOM, we've done our job
return;
}
// Test the next parent
el = el.parentNode;
}
// Stop the bouncing -- no parents are scrollable
evt.preventDefault();
};
var handleTouchstart = function(evt) {
// Store the first Y position of the touch
startY = evt.touches ? evt.touches[0].screenY : evt.screenY;
};
var enable = function() {
// Listen to a couple key touch events
window.addEventListener('touchstart', handleTouchstart, supportsPassiveOption ? { passive : false } : false);
window.addEventListener('touchmove', handleTouchmove, supportsPassiveOption ? { passive : false } : false);
enabled = true;
};
var disable = function() {
// Stop listening
window.removeEventListener('touchstart', handleTouchstart, false);
window.removeEventListener('touchmove', handleTouchmove, false);
enabled = false;
};
var isEnabled = function() {
return enabled;
};
// Enable by default if the browser supports -webkit-overflow-scrolling
// Test this by setting the property with JavaScript on an element that exists in the DOM
// Then, see if the property is reflected in the computed style
var testDiv = document.createElement('div');
document.documentElement.appendChild(testDiv);
testDiv.style.WebkitOverflowScrolling = 'touch';
var scrollSupport = 'getComputedStyle' in window && window.getComputedStyle(testDiv)['-webkit-overflow-scrolling'] === 'touch';
document.documentElement.removeChild(testDiv);
if (scrollSupport) {
enable();
}
// A module to support enabling/disabling iNoBounce
var iNoBounce = {
enable: enable,
disable: disable,
isEnabled: isEnabled
};
if (typeof module !== 'undefined' && module.exports) {
// Node.js Support
module.exports = iNoBounce;
}
if (typeof global.define === 'function') {
// AMD Support
(function(define) {
define('iNoBounce', [], function() { return iNoBounce; });
}(global.define));
}
else {
// Browser support
global.iNoBounce = iNoBounce;
}
}(this));
-1
View File
@@ -1 +0,0 @@
(function(global){var startY=0;var enabled=false;var supportsPassiveOption=false;try{var opts=Object.defineProperty({},"passive",{get:function(){supportsPassiveOption=true}});window.addEventListener("test",null,opts)}catch(e){}var handleTouchmove=function(evt){var el=evt.target;while(el!==document.body&&el!==document){var style=window.getComputedStyle(el);if(!style){break}if(el.nodeName==="INPUT"&&el.getAttribute("type")==="range"){return}var scrolling=style.getPropertyValue("-webkit-overflow-scrolling");var overflowY=style.getPropertyValue("overflow-y");var height=parseInt(style.getPropertyValue("height"),10);var isScrollable=scrolling==="touch"&&(overflowY==="auto"||overflowY==="scroll");var canScroll=el.scrollHeight>el.offsetHeight;if(isScrollable&&canScroll){var curY=evt.touches?evt.touches[0].screenY:evt.screenY;var isAtTop=startY<=curY&&el.scrollTop===0;var isAtBottom=startY>=curY&&el.scrollHeight-el.scrollTop===height;if(isAtTop||isAtBottom){evt.preventDefault()}return}el=el.parentNode}evt.preventDefault()};var handleTouchstart=function(evt){startY=evt.touches?evt.touches[0].screenY:evt.screenY};var enable=function(){window.addEventListener("touchstart",handleTouchstart,supportsPassiveOption?{passive:false}:false);window.addEventListener("touchmove",handleTouchmove,supportsPassiveOption?{passive:false}:false);enabled=true};var disable=function(){window.removeEventListener("touchstart",handleTouchstart,false);window.removeEventListener("touchmove",handleTouchmove,false);enabled=false};var isEnabled=function(){return enabled};var testDiv=document.createElement("div");document.documentElement.appendChild(testDiv);testDiv.style.WebkitOverflowScrolling="touch";var scrollSupport="getComputedStyle"in window&&window.getComputedStyle(testDiv)["-webkit-overflow-scrolling"]==="touch";document.documentElement.removeChild(testDiv);if(scrollSupport){enable()}var iNoBounce={enable:enable,disable:disable,isEnabled:isEnabled};if(typeof module!=="undefined"&&module.exports){module.exports=iNoBounce}if(typeof global.define==="function"){(function(define){define("iNoBounce",[],function(){return iNoBounce})})(global.define)}else{global.iNoBounce=iNoBounce}})(this);
-2
View File
File diff suppressed because one or more lines are too long
-1
View File
File diff suppressed because one or more lines are too long
-1480
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-9541
View File
File diff suppressed because it is too large Load Diff
-1
View File
File diff suppressed because one or more lines are too long
-38775
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
-186
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-8
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-725
View File
@@ -1,725 +0,0 @@
var pixi_display;
(function (pixi_display) {
Object.assign(PIXI.Container.prototype, {
renderWebGL: function (renderer) {
if (this._activeParentLayer && this._activeParentLayer != renderer._activeLayer) {
return;
}
if (!this.visible) {
this.displayOrder = 0;
return;
}
this.displayOrder = renderer.incDisplayOrder();
if (this.worldAlpha <= 0 || !this.renderable) {
return;
}
this.containerRenderWebGL(renderer);
},
renderCanvas: function (renderer) {
if (this._activeParentLayer && this._activeParentLayer != renderer._activeLayer) {
return;
}
if (!this.visible) {
this.displayOrder = 0;
return;
}
this.displayOrder = renderer.incDisplayOrder();
if (this.worldAlpha <= 0 || !this.renderable) {
return;
}
this.containerRenderCanvas(renderer);
},
containerRenderWebGL: PIXI.Container.prototype.renderWebGL,
containerRenderCanvas: PIXI.Container.prototype.renderCanvas
});
})(pixi_display || (pixi_display = {}));
Object.assign(PIXI.DisplayObject.prototype, {
parentLayer: null,
_activeParentLayer: null,
parentGroup: null,
zOrder: 0,
zIndex: 0,
updateOrder: 0,
displayOrder: 0,
layerableChildren: true
});
if (PIXI.particles && PIXI.particles.ParticleContainer) {
PIXI.particles.ParticleContainer.prototype.layerableChildren = false;
}
else if (PIXI.ParticleContainer) {
PIXI.ParticleContainer.prototype.layerableChildren = false;
}
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var pixi_display;
(function (pixi_display) {
var utils = PIXI.utils;
var Group = (function (_super) {
__extends(Group, _super);
function Group(zIndex, sorting) {
var _this = _super.call(this) || this;
_this._activeLayer = null;
_this._activeStage = null;
_this._activeChildren = [];
_this._lastUpdateId = -1;
_this.useRenderTexture = false;
_this.useDoubleBuffer = false;
_this.sortPriority = 0;
_this.clearColor = new Float32Array([0, 0, 0, 0]);
_this.canDrawWithoutLayer = false;
_this.canDrawInParentStage = true;
_this.zIndex = 0;
_this.enableSort = false;
_this._tempResult = [];
_this._tempZero = [];
_this.useZeroOptimization = false;
_this.zIndex = zIndex;
_this.enableSort = !!sorting;
if (typeof sorting === 'function') {
_this.on('sort', sorting);
}
return _this;
}
Group.prototype.doSort = function (layer, sorted) {
if (this.listeners('sort', true)) {
for (var i = 0; i < sorted.length; i++) {
this.emit('sort', sorted[i]);
}
}
if (this.useZeroOptimization) {
this.doSortWithZeroOptimization(layer, sorted);
}
else {
sorted.sort(Group.compareZIndex);
}
};
Group.compareZIndex = function (a, b) {
if (a.zIndex !== b.zIndex) {
return a.zIndex - b.zIndex;
}
if (a.zOrder > b.zOrder) {
return -1;
}
if (a.zOrder < b.zOrder) {
return 1;
}
return a.updateOrder - b.updateOrder;
};
Group.prototype.doSortWithZeroOptimization = function (layer, sorted) {
throw new Error("not implemented yet");
};
Group.prototype.clear = function () {
this._activeLayer = null;
this._activeStage = null;
this._activeChildren.length = 0;
};
Group.prototype.addDisplayObject = function (stage, displayObject) {
this.check(stage);
displayObject._activeParentLayer = this._activeLayer;
if (this._activeLayer) {
this._activeLayer._activeChildren.push(displayObject);
}
else {
this._activeChildren.push(displayObject);
}
};
Group.prototype.foundLayer = function (stage, layer) {
this.check(stage);
if (this._activeLayer != null) {
Group.conflict();
}
this._activeLayer = layer;
this._activeStage = stage;
};
Group.prototype.foundStage = function (stage) {
if (!this._activeLayer && !this.canDrawInParentStage) {
this.clear();
}
};
Group.prototype.check = function (stage) {
if (this._lastUpdateId < Group._layerUpdateId) {
this._lastUpdateId = Group._layerUpdateId;
this.clear();
this._activeStage = stage;
}
else if (this.canDrawInParentStage) {
var current = this._activeStage;
while (current && current != stage) {
current = current._activeParentStage;
}
this._activeStage = current;
if (current == null) {
this.clear();
return;
}
}
};
Group.conflict = function () {
if (Group._lastLayerConflict + 5000 < Date.now()) {
Group._lastLayerConflict = Date.now();
console.log("PIXI-display plugin found two layers with the same group in one stage - that's not healthy. Please place a breakpoint here and debug it");
}
};
Group._layerUpdateId = 0;
Group._lastLayerConflict = 0;
return Group;
}(utils.EventEmitter));
pixi_display.Group = Group;
})(pixi_display || (pixi_display = {}));
var pixi_display;
(function (pixi_display) {
var InteractionManager = PIXI.interaction.InteractionManager;
Object.assign(InteractionManager.prototype, {
_queue: [[], []],
_displayProcessInteractive: function (point, displayObject, hitTestOrder, interactive, outOfMask) {
if (!displayObject || !displayObject.visible) {
return 0;
}
var hit = 0, interactiveParent = interactive = displayObject.interactive || interactive;
if (displayObject.hitArea) {
interactiveParent = false;
}
if (displayObject._activeParentLayer) {
outOfMask = false;
}
var mask = displayObject._mask;
if (hitTestOrder < Infinity && mask) {
if (!mask.containsPoint(point)) {
outOfMask = true;
}
}
if (hitTestOrder < Infinity && displayObject.filterArea) {
if (!displayObject.filterArea.contains(point.x, point.y)) {
outOfMask = true;
}
}
var children = displayObject.children;
if (displayObject.interactiveChildren && children) {
for (var i = children.length - 1; i >= 0; i--) {
var child = children[i];
var hitChild = this._displayProcessInteractive(point, child, hitTestOrder, interactiveParent, outOfMask);
if (hitChild) {
if (!child.parent) {
continue;
}
hit = hitChild;
hitTestOrder = hitChild;
}
}
}
if (interactive) {
if (!outOfMask) {
if (hitTestOrder < displayObject.displayOrder) {
if (displayObject.hitArea) {
displayObject.worldTransform.applyInverse(point, this._tempPoint);
if (displayObject.hitArea.contains(this._tempPoint.x, this._tempPoint.y)) {
hit = displayObject.displayOrder;
}
}
else if (displayObject.containsPoint) {
if (displayObject.containsPoint(point)) {
hit = displayObject.displayOrder;
}
}
}
if (displayObject.interactive) {
this._queueAdd(displayObject, hit === Infinity ? 0 : hit);
}
}
else {
if (displayObject.interactive) {
this._queueAdd(displayObject, 0);
}
}
}
return hit;
},
processInteractive: function (strangeStuff, displayObject, func, hitTest, interactive) {
var interactionEvent = null;
var point = null;
if (strangeStuff.data &&
strangeStuff.data.global) {
interactionEvent = strangeStuff;
point = interactionEvent.data.global;
}
else {
point = strangeStuff;
}
this._startInteractionProcess();
this._displayProcessInteractive(point, displayObject, hitTest ? 0 : Infinity, false);
this._finishInteractionProcess(interactionEvent, func);
},
_startInteractionProcess: function () {
this._eventDisplayOrder = 1;
if (!this._queue) {
this._queue = [[], []];
}
this._queue[0].length = 0;
this._queue[1].length = 0;
},
_queueAdd: function (displayObject, order) {
var queue = this._queue;
if (order < this._eventDisplayOrder) {
queue[0].push(displayObject);
}
else {
if (order > this._eventDisplayOrder) {
this._eventDisplayOrder = order;
var q = queue[1];
for (var i = 0; i < q.length; i++) {
queue[0].push(q[i]);
}
queue[1].length = 0;
}
queue[1].push(displayObject);
}
},
_finishInteractionProcess: function (event, func) {
var queue = this._queue;
var q = queue[0];
var i = 0;
for (; i < q.length; i++) {
if (event) {
if (func) {
func(event, q[i], false);
}
}
else {
func(q[i], false);
}
}
q = queue[1];
for (i = 0; i < q.length; i++) {
if (event) {
if (!event.target) {
event.target = q[i];
}
if (func) {
func(event, q[i], true);
}
}
else {
func(q[i], true);
}
}
}
});
})(pixi_display || (pixi_display = {}));
var pixi_display;
(function (pixi_display) {
var LayerTextureCache = (function () {
function LayerTextureCache(layer) {
this.layer = layer;
this.renderTexture = null;
this.doubleBuffer = null;
this.currentBufferIndex = 0;
this._tempRenderTarget = null;
}
LayerTextureCache.prototype.initRenderTexture = function (renderer) {
var width = renderer ? renderer.screen.width : 100;
var height = renderer ? renderer.screen.height : 100;
var resolution = renderer ? renderer.resolution : PIXI.settings.RESOLUTION;
this.renderTexture = PIXI.RenderTexture.create(width, height, resolution);
if (this.layer.group.useDoubleBuffer) {
this.doubleBuffer = [
PIXI.RenderTexture.create(width, height, resolution),
PIXI.RenderTexture.create(width, height, resolution)
];
}
};
LayerTextureCache.prototype.getRenderTexture = function () {
if (!this.renderTexture) {
this.initRenderTexture();
}
return this.renderTexture;
};
LayerTextureCache.prototype.pushTexture = function (renderer) {
var screen = renderer.screen;
if (!this.renderTexture) {
this.initRenderTexture(renderer);
}
var rt = this.renderTexture;
var group = this.layer.group;
var db = this.doubleBuffer;
if (rt.width !== screen.width ||
rt.height !== screen.height ||
rt.baseTexture.resolution !== renderer.resolution) {
rt.baseTexture.resolution = renderer.resolution;
rt.resize(screen.width, screen.height);
if (db) {
db[0].baseTexture.resolution = renderer.resolution;
db[0].resize(screen.width, screen.height);
db[1].baseTexture.resolution = renderer.resolution;
db[1].resize(screen.width, screen.height);
}
}
this._tempRenderTarget = renderer._activeRenderTarget;
renderer.currentRenderer.flush();
if (group.useDoubleBuffer) {
var buffer = db[this.currentBufferIndex];
if (!buffer.baseTexture._glTextures[renderer.CONTEXT_UID]) {
renderer.bindRenderTexture(buffer, null);
if (group.clearColor) {
renderer.clear(group.clearColor);
}
}
renderer.unbindTexture(rt);
rt.baseTexture._glTextures = buffer.baseTexture._glTextures;
rt.baseTexture._glRenderTargets = buffer.baseTexture._glRenderTargets;
this.currentBufferIndex = 1 - this.currentBufferIndex;
buffer = db[this.currentBufferIndex];
renderer.bindRenderTexture(buffer, null);
}
else {
renderer.bindRenderTexture(rt, undefined);
}
if (group.clearColor) {
renderer.clear(group.clearColor);
}
};
LayerTextureCache.prototype.popTexture = function (renderer) {
renderer.currentRenderer.flush();
renderer.bindRenderTarget(this._tempRenderTarget);
this._tempRenderTarget = null;
};
LayerTextureCache.prototype.destroy = function () {
if (this.renderTexture) {
this.renderTexture.destroy();
if (this.doubleBuffer) {
this.doubleBuffer[0].destroy(true);
this.doubleBuffer[1].destroy(true);
}
}
};
return LayerTextureCache;
}());
pixi_display.LayerTextureCache = LayerTextureCache;
var Layer = (function (_super) {
__extends(Layer, _super);
function Layer(group) {
if (group === void 0) { group = null; }
var _this = _super.call(this) || this;
_this.isLayer = true;
_this.group = null;
_this._activeChildren = [];
_this._tempChildren = null;
_this._activeStageParent = null;
_this._sortedChildren = [];
_this._tempLayerParent = null;
_this.insertChildrenBeforeActive = true;
_this.insertChildrenAfterActive = true;
if (group != null) {
_this.group = group;
_this.zIndex = group.zIndex;
}
else {
_this.group = new pixi_display.Group(0, false);
}
_this._tempChildren = _this.children;
return _this;
}
Layer.prototype.beginWork = function (stage) {
var active = this._activeChildren;
this._activeStageParent = stage;
this.group.foundLayer(stage, this);
var groupChildren = this.group._activeChildren;
active.length = 0;
for (var i = 0; i < groupChildren.length; i++) {
groupChildren[i]._activeParentLayer = this;
active.push(groupChildren[i]);
}
groupChildren.length = 0;
};
Layer.prototype.endWork = function () {
var children = this.children;
var active = this._activeChildren;
var sorted = this._sortedChildren;
for (var i = 0; i < active.length; i++) {
this.emit("display", active[i]);
}
sorted.length = 0;
if (this.insertChildrenBeforeActive) {
for (var i = 0; i < children.length; i++) {
sorted.push(children[i]);
}
}
for (var i = 0; i < active.length; i++) {
sorted.push(active[i]);
}
if (!this.insertChildrenBeforeActive &&
this.insertChildrenAfterActive) {
for (var i = 0; i < children.length; i++) {
sorted.push(children[i]);
}
}
if (this.group.enableSort) {
this.doSort();
}
};
Object.defineProperty(Layer.prototype, "useRenderTexture", {
get: function () {
return this.group.useRenderTexture;
},
set: function (value) {
this.group.useRenderTexture = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Layer.prototype, "useDoubleBuffer", {
get: function () {
return this.group.useDoubleBuffer;
},
set: function (value) {
this.group.useDoubleBuffer = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Layer.prototype, "clearColor", {
get: function () {
return this.group.clearColor;
},
set: function (value) {
this.group.clearColor = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Layer.prototype, "sortPriority", {
get: function () {
return this.group.sortPriority;
},
set: function (value) {
this.group.sortPriority = value;
},
enumerable: true,
configurable: true
});
Layer.prototype.getRenderTexture = function () {
if (!this.textureCache) {
this.textureCache = new LayerTextureCache(this);
}
return this.textureCache.getRenderTexture();
};
Layer.prototype.updateDisplayLayers = function () {
};
Layer.prototype.doSort = function () {
this.group.doSort(this, this._sortedChildren);
};
Layer.prototype._preRender = function (renderer) {
if (this._activeParentLayer && this._activeParentLayer != renderer._activeLayer) {
return false;
}
if (!this.visible) {
this.displayOrder = 0;
return false;
}
this.displayOrder = renderer.incDisplayOrder();
if (this.worldAlpha <= 0 || !this.renderable) {
return false;
}
if (this.children !== this._sortedChildren &&
this._tempChildren != this.children) {
this._tempChildren = this.children;
}
this._boundsID++;
this.children = this._sortedChildren;
this._tempLayerParent = renderer._activeLayer;
renderer._activeLayer = this;
return true;
};
Layer.prototype._postRender = function (renderer) {
this.children = this._tempChildren;
renderer._activeLayer = this._tempLayerParent;
this._tempLayerParent = null;
};
Layer.prototype.renderWebGL = function (renderer) {
if (!this._preRender(renderer)) {
return;
}
if (this.group.useRenderTexture) {
if (!this.textureCache) {
this.textureCache = new LayerTextureCache(this);
}
this.textureCache.pushTexture(renderer);
}
this.containerRenderWebGL(renderer);
this._postRender(renderer);
if (this.group.useRenderTexture) {
this.textureCache.popTexture(renderer);
}
};
Layer.prototype.renderCanvas = function (renderer) {
if (this._preRender(renderer)) {
this.containerRenderCanvas(renderer);
this._postRender(renderer);
}
};
Layer.prototype.destroy = function (options) {
if (this.textureCache) {
this.textureCache.destroy();
this.textureCache = null;
}
_super.prototype.destroy.call(this, options);
};
return Layer;
}(PIXI.Container));
pixi_display.Layer = Layer;
})(pixi_display || (pixi_display = {}));
var pixi_display;
(function (pixi_display) {
var Stage = (function (_super) {
__extends(Stage, _super);
function Stage() {
var _this = _super.call(this) || this;
_this.isStage = true;
_this._tempGroups = [];
_this._activeLayers = [];
_this._activeParentStage = null;
return _this;
}
Stage.prototype.clear = function () {
this._activeLayers.length = 0;
this._tempGroups.length = 0;
};
Stage.prototype.destroy = function (options) {
this.clear();
_super.prototype.destroy.call(this, options);
};
Stage.prototype._addRecursive = function (displayObject) {
if (!displayObject.visible) {
return;
}
if (displayObject.isLayer) {
var layer_1 = displayObject;
this._activeLayers.push(layer_1);
layer_1.beginWork(this);
}
if (displayObject != this && displayObject.isStage) {
var stage = displayObject;
stage.updateAsChildStage(this);
return;
}
var group = displayObject.parentGroup;
if (group !== null) {
group.addDisplayObject(this, displayObject);
}
var layer = displayObject.parentLayer;
if (layer !== null) {
group = layer.group;
group.addDisplayObject(this, displayObject);
}
displayObject.updateOrder = ++Stage._updateOrderCounter;
if (displayObject.alpha <= 0 || !displayObject.renderable
|| !displayObject.layerableChildren
|| group && group.sortPriority) {
return;
}
var children = displayObject.children;
if (children && children.length) {
for (var i = 0; i < children.length; i++) {
this._addRecursive(children[i]);
}
}
};
Stage.prototype._addRecursiveChildren = function (displayObject) {
if (displayObject.alpha <= 0 || !displayObject.renderable
|| !displayObject.layerableChildren) {
return;
}
var children = displayObject.children;
if (children && children.length) {
for (var i = 0; i < children.length; i++) {
this._addRecursive(children[i]);
}
}
};
Stage.prototype._updateStageInner = function () {
this.clear();
this._addRecursive(this);
var layers = this._activeLayers;
for (var i = 0; i < layers.length; i++) {
var layer = layers[i];
if (layer.group.sortPriority) {
layer.endWork();
var sorted = layer._sortedChildren;
for (var j = 0; j < sorted.length; j++) {
this._addRecursiveChildren(sorted[j]);
}
}
}
for (var i = 0; i < layers.length; i++) {
var layer = layers[i];
if (!layer.group.sortPriority) {
layer.endWork();
}
}
};
Stage.prototype.updateAsChildStage = function (stage) {
this._activeParentStage = stage;
Stage._updateOrderCounter = 0;
this._updateStageInner();
};
Stage.prototype.updateStage = function () {
this._activeParentStage = null;
pixi_display.Group._layerUpdateId++;
this._updateStageInner();
};
;
Stage._updateOrderCounter = 0;
return Stage;
}(pixi_display.Layer));
pixi_display.Stage = Stage;
})(pixi_display || (pixi_display = {}));
var pixi_display;
(function (pixi_display) {
Object.assign(PIXI.WebGLRenderer.prototype, {
_lastDisplayOrder: 0,
_activeLayer: null,
incDisplayOrder: function () {
return ++this._lastDisplayOrder;
},
_oldRender: PIXI.WebGLRenderer.prototype.render,
render: function (displayObject, renderTexture, clear, transform, skipUpdateTransform) {
if (!renderTexture) {
this._lastDisplayOrder = 0;
}
this._activeLayer = null;
if (displayObject.isStage) {
displayObject.updateStage();
}
this._oldRender(displayObject, renderTexture, clear, transform, skipUpdateTransform);
}
});
Object.assign(PIXI.CanvasRenderer.prototype, {
_lastDisplayOrder: 0,
_activeLayer: null,
incDisplayOrder: function () {
return ++this._lastDisplayOrder;
},
_oldRender: PIXI.CanvasRenderer.prototype.render,
render: function (displayObject, renderTexture, clear, transform, skipUpdateTransform) {
if (!renderTexture) {
this._lastDisplayOrder = 0;
}
this._activeLayer = null;
if (displayObject.isStage) {
displayObject.updateStage();
}
this._oldRender(displayObject, renderTexture, clear, transform, skipUpdateTransform);
}
});
})(pixi_display || (pixi_display = {}));
var pixi_display;
(function (pixi_display) {
PIXI.display = pixi_display;
})(pixi_display || (pixi_display = {}));
File diff suppressed because one or more lines are too long
-1914
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-3930
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
-42027
View File
File diff suppressed because it is too large Load Diff
-1
View File
File diff suppressed because one or more lines are too long
-21
View File
File diff suppressed because one or more lines are too long
-1
View File
File diff suppressed because one or more lines are too long
-3
View File
File diff suppressed because one or more lines are too long
-1
View File
File diff suppressed because one or more lines are too long
-2
View File
File diff suppressed because one or more lines are too long
+50
View File
@@ -1,2 +1,52 @@
# iwmlib # iwmlib
## Install
Install the following dependencies globally
`npm i rollup gulp-cli -g`
and some dependencies locally
`npm i`
## Build
To build the iwmlib files type
`npm run build`
The files
- imwlib.js
- iwmlib.pixi.js
will be generated in the dist folder. If you want to build the files continuously type
`npm run watch`
To build the 3rd party library type
`npm run 3rdparty`
## Docs
To create the documentation in the folder ./doc/out type `npm run jsdoc`
Afterwards you can view the documentation here:
- The iwmlib [DocTests](./lib/index.html)
- The iwmlib [PixiJS DocTests](./lib/pixi/index.html)
## Useful PixiJS Resources
Currently using PixiJS version 5
- The PixiJS [JavaScript API Docs](http://pixijs.download/dev/docs/index.html)
- The PixiJS [Examples](http://pixijs.github.io/examples/#/basics/basic.js)
- The PixiJS [GitHub Repository](https://github.com/pixijs/pixi.js)
## List of 3<sup>rd</sup> party libraries included
- [PixiJS](http://www.pixijs.com)
- [Greensock](https://greensock.com) with TweenMax and TimelineMax
-7373
View File
File diff suppressed because one or more lines are too long
-55
View File
@@ -1,55 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../lib/3rdparty/highlight/styles/default.css">
<link rel="stylesheet" href="../css/doctest.css">
<script src="../lib/3rdparty/highlight/highlight.pack.js"></script>
<script src="all.js"></script>
<!-- <script type="text/javascript" src="interface.js"></script> -->
</head>
<body onload="Doctest.run()" >
<h1>
Application
</h1>
<p>
IWM Browser Applications follow a common three phase pattern, shared by
many programming environments as diverse as Processing, Arduino, Intern, etc.
<ul>
<li>Instantiate: Initialize the application, in this case a singleton and it's instance variables</li>
<li>Setup: Build more complex parts of the application, by loading data, creating the UI...</li>
<li>Run: Enter and run the main loop of the application.</li>
</ul>
This pattern is reflected by the IApp Interface:
</p>
<pre><code class="js">
class IApp extends Interface {
setup() { return this }
run() { return this }
}
</code></pre>
<p>In practice the pattern may be more complex, because the setup phase can only be entered
after loading things, a main loop cannot be entered because requirements are not met, etc.
But the basic structure is always the same:
</p>
<script type="module" class="doctest">
console.log("Innerhalb script type=module")
import App from "./app.js"
const app = new App()
app.setup()
app.run()
window.app = app
</script>
<p>The setup and run methods can also be chained:
</p>
<script type="module" class="doctest">
app.setup().run()
</script>
<h2>
References
</h2>
<ul>
<li><a href="https://theintern.github.io/intern/#common-config">Intern. Software testing for humans</a></li>
</ul>
</body>
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 515 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1007 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 674 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 482 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 909 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 97 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 633 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 470 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 234 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 613 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 947 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 708 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 803 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 552 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 849 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 624 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 817 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 917 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 857 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 536 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 98 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 624 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 232 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 578 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 569 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 648 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 640 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 560 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 727 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 955 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 428 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 805 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 552 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 973 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 502 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 778 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 778 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 591 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 365 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 273 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 370 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 114 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

Some files were not shown because too many files have changed in this diff Show More