mako 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/mako +133 -0
- data/lib/mako/build.rb +336 -0
- data/lib/mako/data/flash_widget_dev_core/Dependencies.txt +10 -0
- data/lib/mako/data/flash_widget_dev_core/libs/Degrafa_.2.11.swc +0 -0
- data/lib/mako/data/flash_widget_dev_core/libs/KogneatoGraphics.swc +0 -0
- data/lib/mako/data/flash_widget_dev_core/libs/KogneatoSymbols.swc +0 -0
- data/lib/mako/data/flash_widget_dev_core/libs/flash.swc +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/images/RichTextEditor.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/ARLRDBD.TTF +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/FTD_____.TTF +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/verdana.ttf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/verdanab.ttf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/verdanai.ttf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/verdanaz.ttf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/DefaultError.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/barbgfill.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/barshadow.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/bold.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/bullets.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/center.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/close-x.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/fullscreenPopup_close.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/gameTypeIcons/mc.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/gameTypeIcons/mc2.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/gameTypeIcons/mc3.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/gameTypeIcons/qa.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/gameTypeIcons/so.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/importIcon.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/italic.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/justify.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/kogLogo.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/left.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-href-disabled.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-href.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-pagelink-disabled.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-pagelink.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-tooltip-delete.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-tooltip-disabled.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-tooltip-edit.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-tooltip.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/pencil.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/right.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/underline.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayButton.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerPauseButton.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerPauseButton_over.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerPlayButton.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerPlayButton_over.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerSoundButton.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerSoundButton_over.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/styles/creatorStyle.css +57 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/styles/style.css +929 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/swf/embeddedfonts.swf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/swf/helpBubble.swf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/swf/kogneatoSymbols.swf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/swf/videobg.swf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/LICENSE.txt +27 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/CubeRotate.as +48 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Distortion.as +168 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/DistortionConstants.as +16 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Door.as +57 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Flip.as +62 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Gate.as +57 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Pop.as +53 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Push.as +48 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/SimpleDistortion.as +619 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/CubeRotateInstance.as +94 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/DistortBaseInstance.as +258 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/DoorInstance.as +116 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/FlipInstance.as +79 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/GateInstance.as +163 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/PopInstance.as +91 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/PushInstance.as +76 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/util/DisplayObjectBounds.as +64 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/util/DisplayObjectBoundsUtil.as +42 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/util/SimpleDisplayObjectBoundsUtil.as +60 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/HMAC.as +108 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/MD5.as +250 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/MD5Stream.as +343 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/SHA1.as +250 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/SHA224.as +226 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/SHA256.as +229 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/WSSEUsernameToken.as +100 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/effects/SaturationFade.as +107 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/effects/SaturationFadeInstance.as +178 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/effects/SaturationFadePopUpBlocker.as +88 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/errors/IllegalStateError.as +57 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/fileformats/vcard/Address.as +41 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/fileformats/vcard/Email.as +34 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/fileformats/vcard/Phone.as +34 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/fileformats/vcard/VCard.as +47 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/fileformats/vcard/VCardParser.as +234 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/images/BitString.as +34 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/images/JPGEncoder.as +584 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/images/PNGEncoder.as +133 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/DynamicURLLoader.as +48 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/IURIResolver.as +70 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/MimeTypeMap.as +192 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/URI.as +2139 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/URIEncodingBitmap.as +122 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/proxies/RFC2817Socket.as +179 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/Database.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/Definition.as +59 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/Dict.as +322 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/DictionaryServer.as +50 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/MatchStrategy.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/Response.as +59 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/ConnectedEvent.as +44 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/DatabaseEvent.as +54 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/DefinitionEvent.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/DefinitionHeaderEvent.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/DictionaryServerEvent.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/DisconnectedEvent.as +44 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/ErrorEvent.as +64 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/MatchEvent.as +54 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/MatchStrategiesEvent.as +56 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/NoMatchEvent.as +44 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/util/CompleteResponseEvent.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/util/SocketHelper.as +70 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSON.as +76 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONDecoder.as +303 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONEncoder.as +277 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONParseError.as +79 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONToken.as +79 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONTokenType.as +49 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONTokenizer.as +605 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/ArrayUtil.as +166 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/DateUtil.as +657 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/DictionaryUtil.as +73 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/IntUtil.as +85 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/NumberFormatter.as +63 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/StringUtil.as +220 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/XMLUtil.as +148 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/webapis/ServiceBase.as +39 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/webapis/URLLoaderBase.as +93 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/webapis/events/ServiceEvent.as +67 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/geom/ColorMatrix.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/GTween.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/GTweenTimeline.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/GTweener.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Back.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Bounce.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Circular.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Cubic.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Elastic.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Exponential.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Linear.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Quadratic.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Quartic.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Quintic.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Sine.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/AutoHidePlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/BlurPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/ColorAdjustPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/ColorTransformPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/CurrentFramePlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/IGTweenPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/MatrixPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/MotionBlurPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/SmartRotationPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/SnappingPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/SoundTransformPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/utils/SWFBridgeAS3.as +83 -0
- data/lib/mako/data/flash_widget_dev_core/src/etc/GUID.as +82 -0
- data/lib/mako/data/flash_widget_dev_core/src/etc/MathExt.as +114 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/OverwriteManager.as +143 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/TweenFilterLite.as +502 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/TweenLite.as +512 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/TweenMax.as +987 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Back.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Bounce.as +22 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Circ.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Cubic.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Elastic.as +27 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Expo.as +16 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Linear.as +16 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Quad.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Quart.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Quint.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Sine.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Strong.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/easing_readme.txt +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/events/TweenEvent.as +26 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/BevelFilterVars.as +63 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/BlurFilterVars.as +42 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/ColorMatrixFilterVars.as +86 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/DropShadowFilterVars.as +66 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/GlowFilterVars.as +57 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/TweenFilterLiteVars.as +93 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/TweenLiteVars.as +269 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/TweenMaxVars.as +103 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/TweenEvent.as +17 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/TweenObject.as +27 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/TweenSingleton.as +86 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/Constant.as +7 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/FastSlow.as +7 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/FastSlowFast.as +8 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/Shake.as +12 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/SlowFast.as +7 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/SlowFastSlow.as +8 -0
- data/lib/mako/data/flash_widget_dev_core/src/jac/image/ImageUtils.as +173 -0
- data/lib/mako/data/flash_widget_dev_core/src/jac/image/ResizeStyle.as +52 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/CreatorBase.mxml +504 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/CreatorConfig.as +45 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/CreatorEvents.as +38 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/Dialog.as +35 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/MateriaButton.as +35 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/PopUpAlert.mxml +271 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/GradientBackground.as +41 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/PercentField.mxml +104 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/ScrollableSizableImage.mxml +654 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/TextAreaWithDefaultText.mxml +94 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/TextInputWithDefaultText.mxml +94 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/VertCenterTextRenderer.mxml +37 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/ImportEvent.as +22 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/itemRenderers/CheckBoxColumn.mxml +23 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/questions/QuestionDetails.mxml +68 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/questions/QuestionDisplay.mxml +38 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/questions/QuestionsDataGrid.mxml +247 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/questions/QuestionsDataGridEvent.as +20 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/questionAnswerDataGrid/QuestionAnswerColumn.as +13 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/questionAnswerDataGrid/QuestionAnswerDataGrid.mxml +692 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/questionAnswerDataGrid/TextInputItem.mxml +584 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/questionAnswerDataGrid/TextInputObject.as +28 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/toolTips/KogneatoToolTip.as +196 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/toolTips/TipManager.as +150 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/help/HelpBubble.mxml +245 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/help/HelpDot.mxml +21 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/help/HelpManager.as +92 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/help/HelpObject.as +33 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/help/IHelpGuided.as +7 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/media/ImageCacherImage.mxml +56 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/media/MateriaUploader.as +61 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/questionStorage/Question.as +386 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/questionStorage/QuestionGroup.as +313 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/questionStorage/QuestionSet.as +21 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/toolTips/KogneatoToolTip.as +196 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/toolTips/TipManager.as +150 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/utils/CommonUtils.as +186 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/utils/DateUtils.as +273 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/utils/ImageCacher.as +93 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/arrays/Randomize.as +19 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/arrays/SimpleClone.as +32 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/Color.as +102 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/Draw.as +65 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/lines/Dashed.as +48 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/lines/Dotted.as +83 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/Check.as +27 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/Rect.as +12 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/RectBevel.as +35 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/RectBorder.as +39 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/RectRound.as +33 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/RectRoundBorder.as +62 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/TriangleEquilateral.as +25 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/X.as +28 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/errors/ScoringError.as +10 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/errors/StorageError.as +10 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/events/ButtonEvent.as +25 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/events/PayloadEvent.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/events/StandardEvent.as +26 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/Question.as +72 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/QuestionGroup.as +87 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/QuestionSet.as +35 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/WidgetSettings.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/coms/ServerEvents.as +17 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/coms/ServerMessageEvent.as +31 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/logging/Log.as +92 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/scoring/Scoring.as +87 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/storage/StorageManager.as +91 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/storage/StorageTable.as +72 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/engines/EngineCore.as +222 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/geom/Dimension.as +76 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/respondus/Respondus.as +612 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/respondus/RespondusAnswer.as +11 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/respondus/RespondusError.as +18 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/respondus/RespondusQuestion.as +43 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/respondus/RespondusQuiz.as +68 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/AlertWindow.as +182 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/BlueButton.as +102 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Button.as +88 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Button_base.as +168 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Component.as +98 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ContentBlocker.as +38 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/FlexUIScaler.as +59 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/FormInput.as +191 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/GrabZoomClip.as +305 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/HelpLayer.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Label.as +25 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/List.as +62 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/List_Base.as +644 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ProcessingBar.as +112 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ProgressBar.as +35 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ProgressBar_base.as +69 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ScrollBar.as +163 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ScrollBar_base.as +378 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ScrollClip.as +468 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ScrollText.as +29 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ScrollText_base.as +295 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/SimpleScrollBar.as +247 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/StageRef.as +34 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/StorageTank.as +233 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/StorageTankHorizontal.as +109 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ToolTip.as +930 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/TweeningDragDropBankList.as +503 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Window.as +144 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Window_base.as +385 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/layout/CenterScale.as +27 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/layout/WindowManager.as +163 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/layout/WindowStage.as +96 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/util/BitField.as +99 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/util/ObjPeek.as +148 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/util/Objects.as +49 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/util/Printer.as +548 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/util/StringUtil.as +12 -0
- data/lib/mako/data/flash_widget_dev_core/src/org/rubyamf/remoting/ssr/FaultEvent.as +37 -0
- data/lib/mako/data/flash_widget_dev_core/src/org/rubyamf/remoting/ssr/RemotingCall.as +211 -0
- data/lib/mako/data/flash_widget_dev_core/src/org/rubyamf/remoting/ssr/RemotingConnection.as +41 -0
- data/lib/mako/data/flash_widget_dev_core/src/org/rubyamf/remoting/ssr/RemotingService.as +214 -0
- data/lib/mako/data/flash_widget_dev_core/src/org/rubyamf/remoting/ssr/ResultEvent.as +36 -0
- data/lib/mako/data/flash_widget_dev_core/src/sandy/util/DistortImage.as +281 -0
- data/lib/mako/data/flash_widget_dev_core/src/sandy/util/SandyPoint.as +29 -0
- data/lib/mako/data/flash_widget_dev_core/src/sandy/util/Triangle.as +32 -0
- data/lib/mako/data/html/thistest.html +0 -0
- data/lib/mako/data/template_creator/src/Creator.mxml +138 -0
- data/lib/mako/data/template_creator/src/assets/images/RichTextEditor.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/DefaultError.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/barbgfill.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/barshadow.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/bold.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/bullets.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/center.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/close-x.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/fullscreenPopup_close.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/importIcon.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/italic.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/justify.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/left.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-href-disabled.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-href.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-pagelink-disabled.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-pagelink.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-tooltip-delete.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-tooltip-disabled.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-tooltip-edit.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-tooltip.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/pencil.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/right.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/underline.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayButton.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerPauseButton.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerPauseButton_over.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerPlayButton.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerPlayButton_over.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerSoundButton.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerSoundButton_over.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/styles/creatorStyle.css +63 -0
- data/lib/mako/data/template_creator/src/assets/materia/styles/style.css +1127 -0
- data/lib/mako/data/template_creator/src/assets/materia/swf/embeddedfonts.swf +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/swf/helpBubble.swf +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/swf/kogneatoSymbols.swf +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/swf/videobg.swf +0 -0
- data/lib/mako/data/template_creator/src/components/SmallRichTextEditor.mxml +678 -0
- data/lib/mako/data/template_creator/src/components/SmallRichTextEditorToolbar.mxml +133 -0
- data/lib/mako/data/templates/html/README.md +11 -0
- data/lib/mako/data/templates/html/_creator/build.yaml +12 -0
- data/lib/mako/data/templates/html/_creator/creator.html +19 -0
- data/lib/mako/data/templates/html/_creator/css/creator.less +29 -0
- data/lib/mako/data/templates/html/_creator/js/creator.coffee +122 -0
- data/lib/mako/data/templates/html/_creator/test.html +0 -0
- data/lib/mako/data/templates/html/_engine/build.yaml +12 -0
- data/lib/mako/data/templates/html/_engine/css/widget.scss +18 -0
- data/lib/mako/data/templates/html/_engine/js/widget.coffee +143 -0
- data/lib/mako/data/templates/html/_engine/widget.html +21 -0
- data/lib/mako/data/templates/html/_icons/icon-275.png +0 -0
- data/lib/mako/data/templates/html/_icons/icon-394.png +0 -0
- data/lib/mako/data/templates/html/_icons/icon-60.png +0 -0
- data/lib/mako/data/templates/html/_icons/icon-92.png +0 -0
- data/lib/mako/data/templates/html/_score/score_module.php +48 -0
- data/lib/mako/data/templates/html/_score/test_score_module.php +157 -0
- data/lib/mako/data/templates/html/_screen-shots/1-thumb.png +0 -0
- data/lib/mako/data/templates/html/_screen-shots/1.png +0 -0
- data/lib/mako/data/templates/html/_screen-shots/2-thumb.png +0 -0
- data/lib/mako/data/templates/html/_screen-shots/2.png +0 -0
- data/lib/mako/data/templates/html/_screen-shots/3-thumb.png +0 -0
- data/lib/mako/data/templates/html/_screen-shots/3.png +0 -0
- data/lib/mako/data/templates/html/build.yaml +4 -0
- data/lib/mako/data/templates/html/demo.yaml +7 -0
- data/lib/mako/data/templates/html/install.yaml +94 -0
- data/lib/mako/path.rb +48 -0
- data/lib/mako/scaffold.rb +69 -0
- metadata +597 -0
|
@@ -0,0 +1,692 @@
|
|
|
1
|
+
<?xml version = "1.0" encoding = "utf-8"?>
|
|
2
|
+
<mx:DataGrid
|
|
3
|
+
xmlns:mx = "http://www.adobe.com/2006/mxml"
|
|
4
|
+
xmlns:questionAnswerDataGrid = "materia.components.questionAnswerDataGrid.*"
|
|
5
|
+
editable="true"
|
|
6
|
+
rowHeight="75"
|
|
7
|
+
sortableColumns="false"
|
|
8
|
+
initialize="{init()}"
|
|
9
|
+
creationComplete="{onCreationComplete()}"
|
|
10
|
+
dataProvider = "{dataProvider}"
|
|
11
|
+
itemEditBegin="{onItemFocus(event)}"
|
|
12
|
+
dragEnabled="{draggingEnabled}"
|
|
13
|
+
dropEnabled="{draggingEnabled}"
|
|
14
|
+
dragMoveEnabled="{draggingEnabled}"
|
|
15
|
+
draggableColumns="false"
|
|
16
|
+
>
|
|
17
|
+
<mx:columns>
|
|
18
|
+
<mx:DataGridColumn id = "rowNumberColumn" headerText = "" dataField = "rowIndex" editable="false" width = "50">
|
|
19
|
+
<mx:itemRenderer>
|
|
20
|
+
<mx:Component>
|
|
21
|
+
<mx:Canvas width="100%" height="100%" verticalScrollPolicy="off" >
|
|
22
|
+
<mx:Script>
|
|
23
|
+
<![CDATA[
|
|
24
|
+
import materia.components.toolTips.TipManager;
|
|
25
|
+
private var _colorSet:Boolean = false;
|
|
26
|
+
[Bindable]
|
|
27
|
+
private var _parentGrid:QuestionAnswerDataGrid;
|
|
28
|
+
|
|
29
|
+
public override function set data(value:Object):void
|
|
30
|
+
{
|
|
31
|
+
if (parent == null || !(parent.parent is QuestionAnswerDataGrid))
|
|
32
|
+
{
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
super.data = value;
|
|
36
|
+
_parentGrid = QuestionAnswerDataGrid(parent.parent);
|
|
37
|
+
if(importIcon != null)
|
|
38
|
+
{
|
|
39
|
+
importIcon.visible = (data.imported);
|
|
40
|
+
}
|
|
41
|
+
//Set color if needed
|
|
42
|
+
var textColor:int = _parentGrid.indexLabelColor;
|
|
43
|
+
if(textColor != -1 && _colorSet == false)
|
|
44
|
+
{
|
|
45
|
+
rowLabel.setStyle("color", textColor);
|
|
46
|
+
_colorSet = true;
|
|
47
|
+
}
|
|
48
|
+
//Set visibility
|
|
49
|
+
var len:int = _parentGrid.dataProvider.length;
|
|
50
|
+
if(!rowLabel.visible)
|
|
51
|
+
{
|
|
52
|
+
if(value.rowIndex != len)
|
|
53
|
+
{
|
|
54
|
+
rowLabel.visible = true;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
else
|
|
58
|
+
{
|
|
59
|
+
if(value.rowIndex == len)
|
|
60
|
+
{
|
|
61
|
+
rowLabel.visible = false;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
]]>
|
|
66
|
+
</mx:Script>
|
|
67
|
+
<mx:Label id="rowLabel" text="{_parentGrid.useLettersForIndex? String.fromCharCode('A'.charCodeAt(0) + data.rowIndex - 1):data.rowIndex}" textAlign="center" horizontalCenter="0" verticalCenter="0" fontSize="{_parentGrid.indexLabelSize}" fontWeight="bold" />
|
|
68
|
+
<mx:Image id="importIcon"
|
|
69
|
+
source="@Embed(source='/assets/materia/images/importIcon.png')"
|
|
70
|
+
alpha=".8" bottom="5" horizontalCenter="-1"
|
|
71
|
+
mouseOver="{TipManager.showTip(importIcon,'This is an imported question');}"
|
|
72
|
+
/>
|
|
73
|
+
</mx:Canvas>
|
|
74
|
+
</mx:Component>
|
|
75
|
+
</mx:itemRenderer>
|
|
76
|
+
</mx:DataGridColumn>
|
|
77
|
+
<questionAnswerDataGrid:QuestionAnswerColumn id = "questionColumn" dataField = "question.question" headerText = "Question" rendererIsEditor = "true" characterLimit="{characterLimit}">
|
|
78
|
+
<questionAnswerDataGrid:itemRenderer>
|
|
79
|
+
<questionAnswerDataGrid:TextInputItem id = "questionItemRenderer" explanationText = "{questionExplanationText}" placeHolderText="{placeHolderText}" characterLimit="{questionColumn.characterLimit}" multiline="{multilineFields}" restrict="{restrict}" fieldPadding="{fieldPadding}" errorType="question" />
|
|
80
|
+
</questionAnswerDataGrid:itemRenderer>
|
|
81
|
+
</questionAnswerDataGrid:QuestionAnswerColumn>
|
|
82
|
+
<questionAnswerDataGrid:QuestionAnswerColumn id = "answerColumn" dataField = "question.answer" headerText = "Answer" rendererIsEditor = "true" characterLimit="{characterLimit}">
|
|
83
|
+
<questionAnswerDataGrid:itemRenderer>
|
|
84
|
+
<questionAnswerDataGrid:TextInputItem id = "answerItemRenderer" explanationText = "{answerExplanationText}" placeHolderText="{placeHolderText}" characterLimit="{answerColumn.characterLimit}" multiline="{multilineFields}" restrict="{restrict}" fieldPadding="{fieldPadding}" errorType="answer" />
|
|
85
|
+
</questionAnswerDataGrid:itemRenderer>
|
|
86
|
+
</questionAnswerDataGrid:QuestionAnswerColumn>
|
|
87
|
+
<mx:DataGridColumn id="deleteColumn" headerText = "Options" width = "{useSmallDeleteButton?30:80}" editable="false">
|
|
88
|
+
<mx:itemRenderer>
|
|
89
|
+
<mx:Component>
|
|
90
|
+
<mx:Canvas horizontalScrollPolicy="off" tabEnabled="true" tabChildren="true">
|
|
91
|
+
<mx:Button id = "deleteButton"
|
|
92
|
+
paddingLeft="0"
|
|
93
|
+
paddingRight="0"
|
|
94
|
+
left = "5"
|
|
95
|
+
right = "5"
|
|
96
|
+
height = "25"
|
|
97
|
+
label = "Delete"
|
|
98
|
+
horizontalCenter = "0"
|
|
99
|
+
top = "5"
|
|
100
|
+
click = "{QuestionAnswerDataGrid(parent.parent).onDeleteItem(event)}"
|
|
101
|
+
styleName = "redButton"
|
|
102
|
+
initialize="init()"
|
|
103
|
+
>
|
|
104
|
+
</mx:Button>
|
|
105
|
+
<mx:Script>
|
|
106
|
+
<![CDATA[
|
|
107
|
+
import mx.controls.dataGridClasses.DataGridDragProxy;
|
|
108
|
+
public function init():void
|
|
109
|
+
{
|
|
110
|
+
if(parent.parent is QuestionAnswerDataGrid && QuestionAnswerDataGrid(parent.parent).useSmallDeleteButton)
|
|
111
|
+
{
|
|
112
|
+
deleteButton.setStyle('verticalCenter', 0); deleteButton.label='X';
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
//if i remove this "set data" code, everything works fine...
|
|
116
|
+
//if i dont, it breaks :(
|
|
117
|
+
public override function set data(value:Object):void
|
|
118
|
+
{
|
|
119
|
+
if(parent == null || !(parent.parent is QuestionAnswerDataGrid))
|
|
120
|
+
{
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
super.data = value;
|
|
124
|
+
var len:int = QuestionAnswerDataGrid(parent.parent).dataProvider.length;
|
|
125
|
+
if(!deleteButton.visible)
|
|
126
|
+
{
|
|
127
|
+
if(value.rowIndex != len)
|
|
128
|
+
{
|
|
129
|
+
deleteButton.visible = true;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
else
|
|
133
|
+
{
|
|
134
|
+
if(value.rowIndex == len)
|
|
135
|
+
{
|
|
136
|
+
deleteButton.visible = false;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
]]>
|
|
141
|
+
</mx:Script>
|
|
142
|
+
</mx:Canvas>
|
|
143
|
+
</mx:Component>
|
|
144
|
+
</mx:itemRenderer>
|
|
145
|
+
</mx:DataGridColumn>
|
|
146
|
+
</mx:columns>
|
|
147
|
+
<mx:Script>
|
|
148
|
+
<![CDATA[
|
|
149
|
+
import materia.CreatorBase;
|
|
150
|
+
import mx.core.ScrollPolicy;
|
|
151
|
+
import flash.utils.getTimer;
|
|
152
|
+
import mx.events.ScrollEventDirection;
|
|
153
|
+
import mx.events.ScrollEvent;
|
|
154
|
+
import mx.controls.listClasses.IListItemRenderer;
|
|
155
|
+
import mx.events.DragEvent;
|
|
156
|
+
import nm.ui.Component;
|
|
157
|
+
import mx.managers.IFocusManagerComponent;
|
|
158
|
+
import mx.controls.Alert;
|
|
159
|
+
import mx.events.ListEvent;
|
|
160
|
+
import mx.events.FlexEvent;
|
|
161
|
+
import mx.events.DataGridEvent;
|
|
162
|
+
import mx.collections.ArrayCollection;
|
|
163
|
+
import materia.questionStorage.*;
|
|
164
|
+
public static const DELETE_EVENT:String = "DELETE_EVENT";
|
|
165
|
+
public static const ADD_EVENT:String = "ADD_EVENT";
|
|
166
|
+
public static const ROW_FOCUS_EVENT:String = "FOCUSED";
|
|
167
|
+
public static const ENABLE_DRAGGING:String = "DRAG_ENABLED";
|
|
168
|
+
public static const DISABLE_DRAGGING:String = "DRAG_DISABLED";
|
|
169
|
+
private var _lastScrollTime:int = getTimer();
|
|
170
|
+
private var _onInitAddInitialQuestion:Boolean = true;
|
|
171
|
+
[Bindable]
|
|
172
|
+
public var multilineFields:Boolean = true;
|
|
173
|
+
[Bindable]
|
|
174
|
+
public var restrict:String = null;
|
|
175
|
+
[Bindable]
|
|
176
|
+
/**
|
|
177
|
+
* The padding to be used around the input fields used
|
|
178
|
+
* in this datagrid
|
|
179
|
+
*/
|
|
180
|
+
public var fieldPadding:int = 5;
|
|
181
|
+
/**
|
|
182
|
+
* Must be set in xml construction as a tag
|
|
183
|
+
*/
|
|
184
|
+
public var questionType:String = "QA";
|
|
185
|
+
private var _optionsToAdd:Array = new Array();
|
|
186
|
+
[Bindable]
|
|
187
|
+
public var showWordCount:Boolean = false;
|
|
188
|
+
[Bindable]
|
|
189
|
+
public var characterLimit:int;
|
|
190
|
+
[Bindable]
|
|
191
|
+
public var placeHolderText:String = "\rClick To Add Item";
|
|
192
|
+
[Bindable]
|
|
193
|
+
public var questionExplanationText:String = "Enter a question here";
|
|
194
|
+
[Bindable]
|
|
195
|
+
public var answerExplanationText:String = "Enter an answer here";
|
|
196
|
+
// note data items will have { question: , rowIndex: }
|
|
197
|
+
protected var _questionsList:ArrayCollection;
|
|
198
|
+
[Bindable]
|
|
199
|
+
public var indexLabelSize:int = 21;
|
|
200
|
+
[Bindable]
|
|
201
|
+
/**
|
|
202
|
+
* If set to true, row index labels will use letters instead of numbers
|
|
203
|
+
*/
|
|
204
|
+
public var useLettersForIndex:Boolean = false;
|
|
205
|
+
[Bindable]
|
|
206
|
+
/**
|
|
207
|
+
* If set to true, the delete buttons in the option column will be
|
|
208
|
+
* much smaller and use 'x' as a label instead of 'Delete'
|
|
209
|
+
*/
|
|
210
|
+
public var useSmallDeleteButton:Boolean = false;
|
|
211
|
+
[Bindable]
|
|
212
|
+
/**
|
|
213
|
+
* If set to false, dragging will be disabled for this datagrid
|
|
214
|
+
*/
|
|
215
|
+
public var draggingEnabled:Boolean = true;
|
|
216
|
+
[Bindable]
|
|
217
|
+
private var _indexLabelColor:int = 0x202020; //set to -1 for no color
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* getNewQuestion returns an instance of the widget's Question class
|
|
221
|
+
* Widgets use Question by default as defined by CreatorBase.QUESTION_TYPE
|
|
222
|
+
* but can be overriden in widget's creator to use a custom Question class
|
|
223
|
+
**/
|
|
224
|
+
public function getNewQuestion(type:String = "MC", options:Object = null, id:Number = 0, question:String = null, answer:String = null):Question
|
|
225
|
+
{
|
|
226
|
+
var questionClass:Class = getNewQuestionClass();
|
|
227
|
+
return new questionClass(type, options, id, question, answer);
|
|
228
|
+
}
|
|
229
|
+
public function getNewQuestionClass():Class
|
|
230
|
+
{
|
|
231
|
+
return getDefinitionByName(CreatorBase.QUESTION_TYPE) as Class;
|
|
232
|
+
}
|
|
233
|
+
public static function cleanUpDataProvider(dp:ArrayCollection, keepEmptyLastEntry:Boolean = true, cleanEmptyEntries:Boolean = false):void
|
|
234
|
+
{
|
|
235
|
+
for(var i:int = 0; i < dp.length; i++)
|
|
236
|
+
{
|
|
237
|
+
dp.getItemAt(i).rowIndex = i + 1;
|
|
238
|
+
if(dp.getItemAt(i).question.question.length == 0 && dp.getItemAt(i).question.answer.length == 0 && (!keepEmptyLastEntry || i < dp.length - 1))
|
|
239
|
+
{
|
|
240
|
+
dp.removeItemAt(i);
|
|
241
|
+
i--;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
public override function setFocus():void
|
|
246
|
+
{
|
|
247
|
+
super.setFocus();
|
|
248
|
+
this.validateNow();
|
|
249
|
+
dataProvider.refresh();
|
|
250
|
+
}
|
|
251
|
+
public override function set selectedIndex(value:int):void
|
|
252
|
+
{
|
|
253
|
+
super.selectedIndex = value;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Adds a question to the datagrid
|
|
257
|
+
* @param q The question to be used to populate this row
|
|
258
|
+
* @param stealFocus Whether or not this question should have focus after being added
|
|
259
|
+
* @param stickToBottom To be used only to maintain a placeholder at the bottom of the datagrid
|
|
260
|
+
*/
|
|
261
|
+
public function addQuestion(q:Question = null, stealFocus:Boolean = true, stickToBottom:Boolean = false):void
|
|
262
|
+
{
|
|
263
|
+
//Where this item will be added (to bottom or 1 from bottom)
|
|
264
|
+
var rowIndex:int = dataProvider.length - (stickToBottom? 0:1);
|
|
265
|
+
if(rowIndex < 0)
|
|
266
|
+
{
|
|
267
|
+
rowIndex = 0;
|
|
268
|
+
}
|
|
269
|
+
//Create a question if none was passed
|
|
270
|
+
if(q == null)
|
|
271
|
+
{
|
|
272
|
+
q = getNewQuestion(questionType, null, 0, "", "");
|
|
273
|
+
for(var i:int = 0; i < _optionsToAdd.length; i++)
|
|
274
|
+
{
|
|
275
|
+
q.addOption(_optionsToAdd[i],'');
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
/*
|
|
279
|
+
* Items in data grid will contain the following variables:
|
|
280
|
+
* rowIndex
|
|
281
|
+
* question
|
|
282
|
+
* answer
|
|
283
|
+
* imported
|
|
284
|
+
* importModified
|
|
285
|
+
* id
|
|
286
|
+
*/
|
|
287
|
+
var listItem:TextInputObject = new TextInputObject(stealFocus, rowIndex + 1, q, (q.id > 0), false);
|
|
288
|
+
//Add item at the given position
|
|
289
|
+
dataProvider.addItemAt(listItem, rowIndex);
|
|
290
|
+
//Update the "row count" numbers (used for more than just display purposes)
|
|
291
|
+
updateItemIndexes(rowIndex + 1);
|
|
292
|
+
//select the new item
|
|
293
|
+
this.selectedIndex = rowIndex - (stickToBottom? 1:0);
|
|
294
|
+
if(stickToBottom)
|
|
295
|
+
{
|
|
296
|
+
callLater(validateMe);
|
|
297
|
+
}
|
|
298
|
+
dispatchEvent(new Event(ADD_EVENT));
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Deletes an item from the datagrid and updates numbers in the
|
|
302
|
+
* numbers column for proceeding items. Dispatches a delete event
|
|
303
|
+
* and an item edit event.
|
|
304
|
+
*
|
|
305
|
+
* @deleteIndex
|
|
306
|
+
*/
|
|
307
|
+
public function deleteItem(deleteIndex:int = -1):void
|
|
308
|
+
{
|
|
309
|
+
var selectionIndex:int = this.selectedIndex - 1;
|
|
310
|
+
var index:int = deleteIndex == -1? this.selectedIndex : deleteIndex;
|
|
311
|
+
var allowDelete:Boolean = false; // deleting only allowed if >1 item exists
|
|
312
|
+
// establish boundaries
|
|
313
|
+
if(index < 0)
|
|
314
|
+
{
|
|
315
|
+
index = 0;
|
|
316
|
+
}
|
|
317
|
+
// if deleting any item other than the last item
|
|
318
|
+
if(index < dataProvider.length-1)
|
|
319
|
+
{
|
|
320
|
+
allowDelete = true;
|
|
321
|
+
}
|
|
322
|
+
// if selecting the last item
|
|
323
|
+
else if(index > 0)
|
|
324
|
+
{
|
|
325
|
+
var listItem:Object = dataProvider.getItemAt(index-1);
|
|
326
|
+
//If prior question is empty, allow deletion of this question (the last question)
|
|
327
|
+
if(!listItem.question.answer.length && !listItem.question.question.length)
|
|
328
|
+
{
|
|
329
|
+
allowDelete = true;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
// if deletion is not allowed, we're done here
|
|
333
|
+
if(!allowDelete)
|
|
334
|
+
{
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
/* Proceed to delete item */
|
|
338
|
+
var obj:Object = dataProvider.getItemAt(index); // the object to delete
|
|
339
|
+
var wasEmpty:Boolean = false; // if deleted object is empty
|
|
340
|
+
// determine if deleted object is empty
|
|
341
|
+
if(obj.question.question.length == 0 && obj.question.answer.length == 0)
|
|
342
|
+
{
|
|
343
|
+
wasEmpty = true;
|
|
344
|
+
}
|
|
345
|
+
// remove the item and update the numbers (on the left) for all proceeding items
|
|
346
|
+
dataProvider.removeItemAt(index);
|
|
347
|
+
updateItemIndexes(index);
|
|
348
|
+
// restore selection (useful if we deleted the item we had selected)
|
|
349
|
+
this.selectedIndex = selectionIndex;
|
|
350
|
+
//only consider data changed if there was content in deleted item
|
|
351
|
+
if(wasEmpty == false)
|
|
352
|
+
{
|
|
353
|
+
dispatchEvent(new Event(FlexEvent.DATA_CHANGE));
|
|
354
|
+
}
|
|
355
|
+
// let listeners know we deleted this item and "edited" it
|
|
356
|
+
dispatchEvent(new Event(DELETE_EVENT));
|
|
357
|
+
dispatchEvent(new DataGridEvent(DataGridEvent.ITEM_EDIT_END));
|
|
358
|
+
}
|
|
359
|
+
public function equalizeColumnWidths():void
|
|
360
|
+
{
|
|
361
|
+
this.horizontalScrollPolicy = ScrollPolicy.ON;
|
|
362
|
+
var totalWidth:int = 0;
|
|
363
|
+
var numColumns:int = 0;
|
|
364
|
+
// set helper columns to original size
|
|
365
|
+
rowNumberColumn.width = 50;
|
|
366
|
+
deleteColumn.width = useSmallDeleteButton ? 30 : 80;
|
|
367
|
+
totalWidth = this.width - rowNumberColumn.width - deleteColumn.width;
|
|
368
|
+
//Calculate total width of columns to be adjusted
|
|
369
|
+
for(var j:int = 0; j < columns.length; j++)
|
|
370
|
+
{
|
|
371
|
+
if(DataGridColumn(columns[j]).visible && (DataGridColumn(columns[j]).editable))
|
|
372
|
+
{
|
|
373
|
+
numColumns++;
|
|
374
|
+
}
|
|
375
|
+
else if(!DataGridColumn(columns[j]).visible)
|
|
376
|
+
{
|
|
377
|
+
DataGridColumn(columns[j]).width = 0; // no width for invisible columns
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
//Store target width for columns ( the -1 is a hack fix >_< )
|
|
381
|
+
var colWidth:int = totalWidth/numColumns-1;
|
|
382
|
+
//Adjust width of each column based on calculations
|
|
383
|
+
for(var i:int = 0; i < columns.length; i++)
|
|
384
|
+
{
|
|
385
|
+
if(DataGridColumn(columns[i]).visible && (DataGridColumn(columns[i]).editable))
|
|
386
|
+
{
|
|
387
|
+
DataGridColumn(columns[i]).width = colWidth;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
this.horizontalScrollPolicy = ScrollPolicy.OFF;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Adds a standard column to the datagrid using the TextInput item from the other columns
|
|
394
|
+
* Returns the datagrid column that was added
|
|
395
|
+
*/
|
|
396
|
+
public function addOptionColumn(header:String, dataField:String, position:int = -1, isOptional:Boolean = false, characterLimit:int = 0, explanationText:String = "Enter text here", restrict:String = null):DataGridColumn
|
|
397
|
+
{
|
|
398
|
+
////trace("QuestionAnswerDataGrid::addOptionColumn");
|
|
399
|
+
//Add the custom field into the question object
|
|
400
|
+
_optionsToAdd.push(dataField);
|
|
401
|
+
if(dataProvider != null)
|
|
402
|
+
{
|
|
403
|
+
for(var i:int = 0; i < dataProvider.length; i++)
|
|
404
|
+
{
|
|
405
|
+
var question:Question = (dataProvider[i].question as Question)
|
|
406
|
+
if(question.options == null || question.options.hint == null)
|
|
407
|
+
{
|
|
408
|
+
question.addOption(_optionsToAdd[_optionsToAdd.length-1],'');
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
var newColumn:DataGridColumn = new DataGridColumn();
|
|
413
|
+
newColumn.headerText = header;
|
|
414
|
+
newColumn.dataField = 'question.options.' + dataField;
|
|
415
|
+
var itemR:TextInputItem = new TextInputItem();
|
|
416
|
+
itemR.errorColoringEnabled = false;
|
|
417
|
+
itemR.showWordCount = showWordCount;
|
|
418
|
+
if (characterLimit > 0)
|
|
419
|
+
{
|
|
420
|
+
itemR.characterLimit = characterLimit;
|
|
421
|
+
}
|
|
422
|
+
else
|
|
423
|
+
{
|
|
424
|
+
itemR.characterLimit = this.characterLimit;
|
|
425
|
+
}
|
|
426
|
+
newColumn.itemRenderer = itemR;
|
|
427
|
+
newColumn.rendererIsEditor = true;
|
|
428
|
+
itemR.placeHolderText = placeHolderText;
|
|
429
|
+
itemR.explanationText = explanationText;
|
|
430
|
+
itemR.restrict = restrict;
|
|
431
|
+
//Add the column to the datagrid
|
|
432
|
+
addCustomColumn(newColumn, position);
|
|
433
|
+
return newColumn;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Adds a given column to the datagrid. The given DataGridColumn object can be specified as liked
|
|
437
|
+
*/
|
|
438
|
+
public function addCustomColumn(newColumn:DataGridColumn, position:int = -1):void
|
|
439
|
+
{
|
|
440
|
+
////trace("QuestionAnswerDataGrid::addCustomColumn");
|
|
441
|
+
var currentColumns:Array = this.columns;
|
|
442
|
+
if(position == -1)
|
|
443
|
+
{
|
|
444
|
+
if(currentColumns[currentColumns.length - 1] != deleteColumn) currentColumns.push(newColumn);
|
|
445
|
+
else currentColumns.splice(currentColumns.length - 1, 0, newColumn);
|
|
446
|
+
}
|
|
447
|
+
else
|
|
448
|
+
{
|
|
449
|
+
currentColumns.splice(position, 0, newColumn);
|
|
450
|
+
}
|
|
451
|
+
this.columns = currentColumns;
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* Generates a QuestionGroup object from the items in the datagrid
|
|
455
|
+
*/
|
|
456
|
+
public function generateQGroup(title:String = '', random:Boolean = false, id:int = 0):QuestionGroup
|
|
457
|
+
{
|
|
458
|
+
////trace("QuestionAnswerDataGrid::generateQGroup");
|
|
459
|
+
var qGroup:QuestionGroup = new QuestionGroup(title, null, random, id);
|
|
460
|
+
var arr:ArrayCollection = ArrayCollection(dataProvider);
|
|
461
|
+
var n:int = arr.length;
|
|
462
|
+
for(var i:int = 0; i < n-1; i++) // ignore placeholder
|
|
463
|
+
{
|
|
464
|
+
qGroup.addQuestion(arr.getItemAt(i).question);
|
|
465
|
+
}
|
|
466
|
+
// if we don't have a placeholder, add the last item too
|
|
467
|
+
if(n > 0 && arr.getItemAt(n-1).question.question.length > 0)
|
|
468
|
+
{
|
|
469
|
+
qGroup.addQuestion(arr.getItemAt(n-1).question);
|
|
470
|
+
}
|
|
471
|
+
return qGroup;
|
|
472
|
+
}
|
|
473
|
+
// similar to generate qGroup, but takes gets the data from a given dataprovider
|
|
474
|
+
// theDataProvider is formated as if it is used in a QuestionAnswerDataGrid
|
|
475
|
+
// this lets us get a qgroup from this kind of dataprovider without having to load it into a
|
|
476
|
+
// QuestionAnswerDataGrid
|
|
477
|
+
public static function generateQGroupFromDataProvider(theDataProvider:ArrayCollection,
|
|
478
|
+
title:String = '', random:Boolean = false, id:int = 0):QuestionGroup
|
|
479
|
+
{
|
|
480
|
+
var qGroup:QuestionGroup = new QuestionGroup(title, null, random, id);
|
|
481
|
+
var arr:ArrayCollection = theDataProvider;
|
|
482
|
+
var n:int = arr.length;
|
|
483
|
+
for(var i:int = 0; i < n-1; i++)
|
|
484
|
+
{
|
|
485
|
+
qGroup.addQuestion(arr.getItemAt(i).question);
|
|
486
|
+
}
|
|
487
|
+
if(n > 0 && arr.getItemAt(n-1).question.question.length > 0)
|
|
488
|
+
{
|
|
489
|
+
qGroup.addQuestion(arr.getItemAt(n-1).question);
|
|
490
|
+
}
|
|
491
|
+
return qGroup;
|
|
492
|
+
}
|
|
493
|
+
public function set answerHeaderLabel(label:String):void
|
|
494
|
+
{
|
|
495
|
+
answerColumn.headerText = label;
|
|
496
|
+
}
|
|
497
|
+
public function set indexLabelColor(label:int):void
|
|
498
|
+
{
|
|
499
|
+
_indexLabelColor = label;
|
|
500
|
+
}
|
|
501
|
+
public function get indexLabelColor():int
|
|
502
|
+
{
|
|
503
|
+
return _indexLabelColor;
|
|
504
|
+
}
|
|
505
|
+
public function set questionHeaderLabel(label:String):void
|
|
506
|
+
{
|
|
507
|
+
questionColumn.headerText = label;
|
|
508
|
+
}
|
|
509
|
+
public function set onInitAddInitialQuestion(addFirst:Boolean):void
|
|
510
|
+
{
|
|
511
|
+
_onInitAddInitialQuestion = addFirst;
|
|
512
|
+
}
|
|
513
|
+
// this should be given when creating this component
|
|
514
|
+
public function set questionsList(qList:ArrayCollection):void
|
|
515
|
+
{
|
|
516
|
+
_questionsList = qList;
|
|
517
|
+
}
|
|
518
|
+
public function refreshRowData(rowIndex:int):void
|
|
519
|
+
{
|
|
520
|
+
dataProvider.setItemAt(dataProvider.getItemAt(rowIndex), rowIndex);
|
|
521
|
+
}
|
|
522
|
+
public function setRowData(rowIndex:int, data:Object):void
|
|
523
|
+
{
|
|
524
|
+
dataProvider.setItemAt(data, rowIndex);
|
|
525
|
+
}
|
|
526
|
+
public function onDeleteItem(event:Event):void
|
|
527
|
+
{
|
|
528
|
+
deleteItem(event.target.parentDocument.data.rowIndex-1);
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* Updates the displayed index of each row starting with the one given
|
|
532
|
+
*/
|
|
533
|
+
public function updateItemIndexes(startIndex:int = 0):void
|
|
534
|
+
{
|
|
535
|
+
if(dataProvider == null)
|
|
536
|
+
{
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
for(var i:int = startIndex; i < dataProvider.length; i++)
|
|
540
|
+
{
|
|
541
|
+
dataProvider.getItemAt(i).rowIndex = i + 1;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Returns the item renderer at the given index.
|
|
546
|
+
* This is different from the indicesToItemRender function that returns
|
|
547
|
+
* an item renderer at a given recycled index.
|
|
548
|
+
*
|
|
549
|
+
* i.e.
|
|
550
|
+
* to access the item in the 37th row in the 4th column, call
|
|
551
|
+
* indicesToItemRendererUnrecycled(37, 4). If this item isn't visible,
|
|
552
|
+
* it return null.
|
|
553
|
+
* the original indicesToItemRender function returns the item at the visible
|
|
554
|
+
* indeces provided. if 100 items are on screen and items 20-30 are visible,
|
|
555
|
+
* indicesToItemRender(5, 0) returns the 5th visible element in the list which
|
|
556
|
+
* is equivalent to the 25th element in the list.
|
|
557
|
+
*/
|
|
558
|
+
public function indicesToItemRendererUnrecycled(rowIndex:int, colIndex:int):IListItemRenderer
|
|
559
|
+
{
|
|
560
|
+
var firstItemIndex:int = verticalScrollPosition - offscreenExtraRowsTop;
|
|
561
|
+
if (rowIndex < firstItemIndex || rowIndex >= firstItemIndex + listItems.length)
|
|
562
|
+
{
|
|
563
|
+
return null;
|
|
564
|
+
}
|
|
565
|
+
return listItems[rowIndex - firstItemIndex][colIndex];
|
|
566
|
+
}
|
|
567
|
+
[Bindable (event='varChanged_numQuestions')]
|
|
568
|
+
public function get numQuestions():int
|
|
569
|
+
{
|
|
570
|
+
return dataProvider.length - 1;
|
|
571
|
+
}
|
|
572
|
+
protected function init():void
|
|
573
|
+
{
|
|
574
|
+
//trace("QuestionAnswerDataGrid::init");
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* Update item indexes whenever an item is dropped after dragging.
|
|
578
|
+
* Also makes sure that if we drag an item below the empty
|
|
579
|
+
* "Click To Add Item" placeholder, we swap the last two elements
|
|
580
|
+
* so the placeholder stays at the bottom.
|
|
581
|
+
*/
|
|
582
|
+
override protected function dragDropHandler(event:DragEvent):void
|
|
583
|
+
{
|
|
584
|
+
super.dragDropHandler(event);
|
|
585
|
+
// if we dropped below the last item (the placeholder), swap the
|
|
586
|
+
// placeholder back down
|
|
587
|
+
if(calculateDropIndex(event) > dataProvider.length - 1 && dataProvider.length > 1)
|
|
588
|
+
{
|
|
589
|
+
var temp:Object = dataProvider[dataProvider.length - 1];
|
|
590
|
+
dataProvider[dataProvider.length - 1] = dataProvider[dataProvider.length - 2];
|
|
591
|
+
dataProvider[dataProvider.length - 2] = temp;
|
|
592
|
+
}
|
|
593
|
+
// update the item indexes
|
|
594
|
+
updateItemIndexes(0);
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* Overridedn to prevent dragging of the last item (the placeholder)
|
|
598
|
+
*/
|
|
599
|
+
override protected function dragStartHandler(event:DragEvent):void
|
|
600
|
+
{
|
|
601
|
+
if(selectedIndex == dataProvider.length - 1)
|
|
602
|
+
{
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
super.dragStartHandler(event);
|
|
606
|
+
}
|
|
607
|
+
// Attempt to slow down mouse wheel:
|
|
608
|
+
override protected function mouseWheelHandler(event:MouseEvent):void
|
|
609
|
+
{
|
|
610
|
+
if(event.delta > 0)
|
|
611
|
+
{
|
|
612
|
+
event.delta = Math.max(1, event.delta / 8);
|
|
613
|
+
}
|
|
614
|
+
else
|
|
615
|
+
{
|
|
616
|
+
event.delta = -Math.max(1, Math.abs(event.delta / 8));
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
super.mouseWheelHandler(event);
|
|
620
|
+
}
|
|
621
|
+
protected function onCreationComplete():void
|
|
622
|
+
{
|
|
623
|
+
if (_onInitAddInitialQuestion !== false)
|
|
624
|
+
{
|
|
625
|
+
addQuestion(null, false, true);
|
|
626
|
+
}
|
|
627
|
+
validateMe(null);
|
|
628
|
+
if (_questionsList != null)
|
|
629
|
+
{
|
|
630
|
+
// make the data provider based on the questions list
|
|
631
|
+
for (var i:int = 0; i < _questionsList.length; i++)
|
|
632
|
+
{
|
|
633
|
+
// Need to cast each question to widget's Question class
|
|
634
|
+
addQuestion((getNewQuestionClass())(_questionsList.getItemAt(i)), false);
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
// Add listeners to temporarily disable dragging (i.e. when selecting text)
|
|
638
|
+
// These events are bubbled from TextInputItem
|
|
639
|
+
addEventListener(ENABLE_DRAGGING, enableDragging, false, 0, true);
|
|
640
|
+
addEventListener(DISABLE_DRAGGING, disableDragging, false, 0, true);
|
|
641
|
+
}
|
|
642
|
+
protected function validateMe(event:Event = null):void
|
|
643
|
+
{
|
|
644
|
+
try
|
|
645
|
+
{
|
|
646
|
+
this.validateNow();
|
|
647
|
+
dataProvider.refresh();
|
|
648
|
+
}
|
|
649
|
+
catch (e:Error)
|
|
650
|
+
{
|
|
651
|
+
trace("datagrid validation error");
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* Event triggered function that enables dragging.
|
|
656
|
+
* Called whenever focus leaves an input field (i.e. clicking
|
|
657
|
+
* somewhere to start dragging)
|
|
658
|
+
*/
|
|
659
|
+
private function enableDragging(e:Event):void
|
|
660
|
+
{
|
|
661
|
+
if(draggingEnabled)
|
|
662
|
+
{
|
|
663
|
+
e.stopPropagation();
|
|
664
|
+
this.dragMoveEnabled = true;
|
|
665
|
+
this.dragEnabled = true;
|
|
666
|
+
this.dropEnabled = true;
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* Event triggered function that disables dragging.
|
|
671
|
+
* Called whenever focus enters an input field (i.e. selecting
|
|
672
|
+
* text). This makes it so the user can select text without the
|
|
673
|
+
* entire row going into drag mode.
|
|
674
|
+
*/
|
|
675
|
+
private function disableDragging(e:Event):void
|
|
676
|
+
{
|
|
677
|
+
e.stopPropagation();
|
|
678
|
+
this.dragMoveEnabled = false;
|
|
679
|
+
this.dragEnabled = false;
|
|
680
|
+
this.dropEnabled = false;
|
|
681
|
+
}
|
|
682
|
+
private function onItemFocus(event:Event):void
|
|
683
|
+
{
|
|
684
|
+
// User selected placeholder, add a new question
|
|
685
|
+
if(selectedIndex == dataProvider.length-1)
|
|
686
|
+
{
|
|
687
|
+
addQuestion(null, false, true);
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
]]>
|
|
691
|
+
</mx:Script>
|
|
692
|
+
</mx:DataGrid>
|