closure 1.1.692
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/.gitignore +6 -0
- data/.yardopts +3 -0
- data/LICENSE +202 -0
- data/README.md +26 -0
- data/beanshell/LICENSE +12 -0
- data/beanshell/bsh-core-2.0b4.jar +0 -0
- data/closure-compiler/COPYING +202 -0
- data/closure-compiler/README +278 -0
- data/closure-compiler/compiler.jar +0 -0
- data/closure-library/AUTHORS +12 -0
- data/closure-library/LICENSE +176 -0
- data/closure-library/README +6 -0
- data/closure-library/all_tests.html +113 -0
- data/closure-library/alltests.js +16 -0
- data/closure-library/closure/bin/build/closurebuilder.py +257 -0
- data/closure-library/closure/bin/build/depstree.py +186 -0
- data/closure-library/closure/bin/build/depstree_test.py +127 -0
- data/closure-library/closure/bin/build/depswriter.py +197 -0
- data/closure-library/closure/bin/build/jscompiler.py +69 -0
- data/closure-library/closure/bin/build/source.py +86 -0
- data/closure-library/closure/bin/build/source_test.py +57 -0
- data/closure-library/closure/bin/build/treescan.py +78 -0
- data/closure-library/closure/bin/calcdeps.py +570 -0
- data/closure-library/closure/bin/scopify.py +211 -0
- data/closure-library/closure/css/inlay/g-base.css +82 -0
- data/closure-library/closure/css/inlay/g-fixed.css +158 -0
- data/closure-library/closure/css/inlay/g-ratio.css +253 -0
- data/closure-library/closure/goog/array/array.js +1300 -0
- data/closure-library/closure/goog/array/array_test.html +1524 -0
- data/closure-library/closure/goog/asserts/asserts.js +277 -0
- data/closure-library/closure/goog/asserts/asserts_test.html +163 -0
- data/closure-library/closure/goog/async/conditionaldelay.js +238 -0
- data/closure-library/closure/goog/async/conditionaldelay_test.html +227 -0
- data/closure-library/closure/goog/async/delay.js +174 -0
- data/closure-library/closure/goog/async/delay_test.html +148 -0
- data/closure-library/closure/goog/async/throttle.js +189 -0
- data/closure-library/closure/goog/async/throttle_test.html +102 -0
- data/closure-library/closure/goog/base.js +1471 -0
- data/closure-library/closure/goog/base_test.html +1166 -0
- data/closure-library/closure/goog/bootstrap/webworkers.js +37 -0
- data/closure-library/closure/goog/color/alpha.js +436 -0
- data/closure-library/closure/goog/color/alpha_test.html +234 -0
- data/closure-library/closure/goog/color/color.js +757 -0
- data/closure-library/closure/goog/color/color_test.html +645 -0
- data/closure-library/closure/goog/color/names.js +176 -0
- data/closure-library/closure/goog/crypt/arc4.js +141 -0
- data/closure-library/closure/goog/crypt/arc4_test.html +42 -0
- data/closure-library/closure/goog/crypt/base64.js +267 -0
- data/closure-library/closure/goog/crypt/base64_test.html +106 -0
- data/closure-library/closure/goog/crypt/basen.js +242 -0
- data/closure-library/closure/goog/crypt/basen_test.html +167 -0
- data/closure-library/closure/goog/crypt/crypt.js +103 -0
- data/closure-library/closure/goog/crypt/crypt_test.html +68 -0
- data/closure-library/closure/goog/crypt/hash32.js +184 -0
- data/closure-library/closure/goog/crypt/hash32_test.html +287 -0
- data/closure-library/closure/goog/crypt/sha1.js +238 -0
- data/closure-library/closure/goog/crypt/sha1_test.html +47 -0
- data/closure-library/closure/goog/css/autocomplete.css +43 -0
- data/closure-library/closure/goog/css/bubble.css +84 -0
- data/closure-library/closure/goog/css/button.css +38 -0
- data/closure-library/closure/goog/css/charpicker.css +201 -0
- data/closure-library/closure/goog/css/checkbox.css +38 -0
- data/closure-library/closure/goog/css/colormenubutton.css +25 -0
- data/closure-library/closure/goog/css/colorpalette.css +54 -0
- data/closure-library/closure/goog/css/colorpicker-simplegrid.css +50 -0
- data/closure-library/closure/goog/css/combobox.css +57 -0
- data/closure-library/closure/goog/css/common.css +41 -0
- data/closure-library/closure/goog/css/css3button.css +77 -0
- data/closure-library/closure/goog/css/css3menubutton.css +23 -0
- data/closure-library/closure/goog/css/custombutton.css +164 -0
- data/closure-library/closure/goog/css/datepicker.css +148 -0
- data/closure-library/closure/goog/css/dialog.css +72 -0
- data/closure-library/closure/goog/css/dimensionpicker.css +47 -0
- data/closure-library/closure/goog/css/dragdropdetector.css +48 -0
- data/closure-library/closure/goog/css/editor/bubble.css +73 -0
- data/closure-library/closure/goog/css/editor/dialog.css +66 -0
- data/closure-library/closure/goog/css/editor/linkdialog.css +36 -0
- data/closure-library/closure/goog/css/editortoolbar.css +225 -0
- data/closure-library/closure/goog/css/filteredmenu.css +30 -0
- data/closure-library/closure/goog/css/filterobservingmenuitem.css +25 -0
- data/closure-library/closure/goog/css/flatbutton.css +65 -0
- data/closure-library/closure/goog/css/flatmenubutton.css +63 -0
- data/closure-library/closure/goog/css/hovercard.css +51 -0
- data/closure-library/closure/goog/css/hsvapalette.css +231 -0
- data/closure-library/closure/goog/css/hsvpalette.css +179 -0
- data/closure-library/closure/goog/css/imagelessbutton.css +160 -0
- data/closure-library/closure/goog/css/imagelessmenubutton.css +23 -0
- data/closure-library/closure/goog/css/inputdatepicker.css +12 -0
- data/closure-library/closure/goog/css/linkbutton.css +26 -0
- data/closure-library/closure/goog/css/menu.css +27 -0
- data/closure-library/closure/goog/css/menubutton.css +169 -0
- data/closure-library/closure/goog/css/menuitem.css +96 -0
- data/closure-library/closure/goog/css/menuseparator.css +19 -0
- data/closure-library/closure/goog/css/multitestrunner.css +121 -0
- data/closure-library/closure/goog/css/offline.css +147 -0
- data/closure-library/closure/goog/css/palette.css +36 -0
- data/closure-library/closure/goog/css/popupdatepicker.css +17 -0
- data/closure-library/closure/goog/css/roundedpanel.css +29 -0
- data/closure-library/closure/goog/css/roundedtab.css +158 -0
- data/closure-library/closure/goog/css/submenu.css +28 -0
- data/closure-library/closure/goog/css/tab.css +91 -0
- data/closure-library/closure/goog/css/tabbar.css +52 -0
- data/closure-library/closure/goog/css/tablesorter.css +14 -0
- data/closure-library/closure/goog/css/toolbar.css +400 -0
- data/closure-library/closure/goog/css/tooltip.css +14 -0
- data/closure-library/closure/goog/css/tree.css +147 -0
- data/closure-library/closure/goog/css/tristatemenuitem.css +43 -0
- data/closure-library/closure/goog/cssom/cssom.js +447 -0
- data/closure-library/closure/goog/cssom/cssom_test.html +343 -0
- data/closure-library/closure/goog/cssom/cssom_test_import_1.css +11 -0
- data/closure-library/closure/goog/cssom/cssom_test_import_2.css +10 -0
- data/closure-library/closure/goog/cssom/cssom_test_link_1.css +10 -0
- data/closure-library/closure/goog/cssom/iframe/style.js +1020 -0
- data/closure-library/closure/goog/cssom/iframe/style_test.html +391 -0
- data/closure-library/closure/goog/cssom/iframe/style_test_import.css +10 -0
- data/closure-library/closure/goog/datasource/datamanager.js +566 -0
- data/closure-library/closure/goog/datasource/datasource.js +646 -0
- data/closure-library/closure/goog/datasource/datasource_test.html +265 -0
- data/closure-library/closure/goog/datasource/expr.js +544 -0
- data/closure-library/closure/goog/datasource/expr_test.html +97 -0
- data/closure-library/closure/goog/datasource/fastdatanode.js +792 -0
- data/closure-library/closure/goog/datasource/fastdatanode_test.html +254 -0
- data/closure-library/closure/goog/datasource/jsdatasource.js +460 -0
- data/closure-library/closure/goog/datasource/jsondatasource.js +146 -0
- data/closure-library/closure/goog/datasource/jsxmlhttpdatasource.js +191 -0
- data/closure-library/closure/goog/datasource/jsxmlhttpdatasource_test.html +94 -0
- data/closure-library/closure/goog/datasource/xmldatasource.js +407 -0
- data/closure-library/closure/goog/date/date.js +1642 -0
- data/closure-library/closure/goog/date/date_test.html +1293 -0
- data/closure-library/closure/goog/date/datelike.js +27 -0
- data/closure-library/closure/goog/date/daterange.js +398 -0
- data/closure-library/closure/goog/date/daterange_test.html +213 -0
- data/closure-library/closure/goog/date/relative.js +425 -0
- data/closure-library/closure/goog/date/relative_test.html +124 -0
- data/closure-library/closure/goog/date/utcdatetime.js +178 -0
- data/closure-library/closure/goog/date/utcdatetime_test.html +119 -0
- data/closure-library/closure/goog/debug/console.js +138 -0
- data/closure-library/closure/goog/debug/debug.js +452 -0
- data/closure-library/closure/goog/debug/debug_test.html +32 -0
- data/closure-library/closure/goog/debug/debugwindow.js +582 -0
- data/closure-library/closure/goog/debug/devcss/devcss.js +435 -0
- data/closure-library/closure/goog/debug/devcss/devcss_test.html +365 -0
- data/closure-library/closure/goog/debug/devcss/devcssrunner.js +26 -0
- data/closure-library/closure/goog/debug/divconsole.js +141 -0
- data/closure-library/closure/goog/debug/enhanceerror_test.html +138 -0
- data/closure-library/closure/goog/debug/entrypointregistry.js +111 -0
- data/closure-library/closure/goog/debug/entrypointregistry_test.html +63 -0
- data/closure-library/closure/goog/debug/error.js +47 -0
- data/closure-library/closure/goog/debug/error_test.html +85 -0
- data/closure-library/closure/goog/debug/errorhandler.js +234 -0
- data/closure-library/closure/goog/debug/errorhandler_async_test.html +112 -0
- data/closure-library/closure/goog/debug/errorhandler_test.html +186 -0
- data/closure-library/closure/goog/debug/errorhandlerweakdep.js +38 -0
- data/closure-library/closure/goog/debug/errorreporter.js +324 -0
- data/closure-library/closure/goog/debug/errorreporter_test.html +289 -0
- data/closure-library/closure/goog/debug/fancywindow.js +265 -0
- data/closure-library/closure/goog/debug/formatter.js +314 -0
- data/closure-library/closure/goog/debug/gcdiagnostics.js +143 -0
- data/closure-library/closure/goog/debug/logbuffer.js +147 -0
- data/closure-library/closure/goog/debug/logbuffer_test.html +105 -0
- data/closure-library/closure/goog/debug/logger.js +809 -0
- data/closure-library/closure/goog/debug/logger_test.html +208 -0
- data/closure-library/closure/goog/debug/logrecord.js +271 -0
- data/closure-library/closure/goog/debug/reflect.js +159 -0
- data/closure-library/closure/goog/debug/reflect_test.html +81 -0
- data/closure-library/closure/goog/debug/relativetimeprovider.js +83 -0
- data/closure-library/closure/goog/debug/tracer.js +750 -0
- data/closure-library/closure/goog/debug/tracer_test.html +57 -0
- data/closure-library/closure/goog/demos/advancedtooltip.html +78 -0
- data/closure-library/closure/goog/demos/animationqueue.html +149 -0
- data/closure-library/closure/goog/demos/autocomplete-basic.html +56 -0
- data/closure-library/closure/goog/demos/autocompleteremote.html +40 -0
- data/closure-library/closure/goog/demos/autocompleteremotedata.js +18 -0
- data/closure-library/closure/goog/demos/autocompleterichremote.html +137 -0
- data/closure-library/closure/goog/demos/autocompleterichremotedata.js +33 -0
- data/closure-library/closure/goog/demos/bidiinput.html +72 -0
- data/closure-library/closure/goog/demos/bubble.html +250 -0
- data/closure-library/closure/goog/demos/button.html +395 -0
- data/closure-library/closure/goog/demos/charcounter.html +57 -0
- data/closure-library/closure/goog/demos/charpicker.html +64 -0
- data/closure-library/closure/goog/demos/checkbox.html +122 -0
- data/closure-library/closure/goog/demos/color-contrast.html +60 -0
- data/closure-library/closure/goog/demos/colormenubutton.html +213 -0
- data/closure-library/closure/goog/demos/colorpicker.html +43 -0
- data/closure-library/closure/goog/demos/combobox.html +125 -0
- data/closure-library/closure/goog/demos/container.html +670 -0
- data/closure-library/closure/goog/demos/control.html +477 -0
- data/closure-library/closure/goog/demos/css/demo.css +75 -0
- data/closure-library/closure/goog/demos/css/emojipicker.css +36 -0
- data/closure-library/closure/goog/demos/css/emojisprite.css +92 -0
- data/closure-library/closure/goog/demos/css3button.html +166 -0
- data/closure-library/closure/goog/demos/css3menubutton.html +285 -0
- data/closure-library/closure/goog/demos/cssspriteanimation.html +80 -0
- data/closure-library/closure/goog/demos/datepicker.html +183 -0
- data/closure-library/closure/goog/demos/debug.html +119 -0
- data/closure-library/closure/goog/demos/depsgraph.html +221 -0
- data/closure-library/closure/goog/demos/dialog.html +156 -0
- data/closure-library/closure/goog/demos/dimensionpicker.html +108 -0
- data/closure-library/closure/goog/demos/dimensionpicker_rtl.html +123 -0
- data/closure-library/closure/goog/demos/dom_selection.html +88 -0
- data/closure-library/closure/goog/demos/drag.html +191 -0
- data/closure-library/closure/goog/demos/dragdrop.html +263 -0
- data/closure-library/closure/goog/demos/dragdropdetector.html +46 -0
- data/closure-library/closure/goog/demos/dragdropdetector_target.html +17 -0
- data/closure-library/closure/goog/demos/dragger.html +83 -0
- data/closure-library/closure/goog/demos/draglistgroup.html +261 -0
- data/closure-library/closure/goog/demos/drilldownrow.html +78 -0
- data/closure-library/closure/goog/demos/editor/deps.js +20 -0
- data/closure-library/closure/goog/demos/editor/editor.html +139 -0
- data/closure-library/closure/goog/demos/editor/field_basic.html +74 -0
- data/closure-library/closure/goog/demos/editor/helloworld.html +91 -0
- data/closure-library/closure/goog/demos/editor/helloworld.js +81 -0
- data/closure-library/closure/goog/demos/editor/helloworld_test.html +75 -0
- data/closure-library/closure/goog/demos/editor/helloworlddialog.js +163 -0
- data/closure-library/closure/goog/demos/editor/helloworlddialog_test.html +100 -0
- data/closure-library/closure/goog/demos/editor/helloworlddialogplugin.js +110 -0
- data/closure-library/closure/goog/demos/editor/helloworlddialogplugin_test.html +198 -0
- data/closure-library/closure/goog/demos/editor/seamlessfield.html +106 -0
- data/closure-library/closure/goog/demos/effects.html +142 -0
- data/closure-library/closure/goog/demos/emoji/200.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/201.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/202.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/203.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/204.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/205.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/206.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2BC.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2BD.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2BE.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2BF.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C0.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C1.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C2.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C3.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C4.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C5.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C6.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C7.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C8.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C9.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2CA.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2CB.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2CC.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2CD.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2CE.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2CF.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D0.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D1.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D2.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D3.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D4.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D5.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D6.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D7.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D8.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D9.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2DA.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2DB.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2DC.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2DD.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2DE.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2DF.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E0.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E1.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E2.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E3.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E4.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E5.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E6.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E7.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E8.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E9.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2EA.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2EB.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2EC.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2ED.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2EE.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2EF.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F0.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F1.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F2.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F3.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F4.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F5.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F6.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F7.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F8.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F9.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2FA.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2FB.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2FC.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2FD.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2FE.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2FF.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/none.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/sprite.png +0 -0
- data/closure-library/closure/goog/demos/emoji/sprite2.png +0 -0
- data/closure-library/closure/goog/demos/emoji/unknown.gif +0 -0
- data/closure-library/closure/goog/demos/event-propagation.html +192 -0
- data/closure-library/closure/goog/demos/events.html +99 -0
- data/closure-library/closure/goog/demos/eventtarget.html +70 -0
- data/closure-library/closure/goog/demos/filedrophandler.html +63 -0
- data/closure-library/closure/goog/demos/filteredmenu.html +118 -0
- data/closure-library/closure/goog/demos/focushandler.html +58 -0
- data/closure-library/closure/goog/demos/gauge.html +158 -0
- data/closure-library/closure/goog/demos/graphics/advancedcoordinates.html +141 -0
- data/closure-library/closure/goog/demos/graphics/advancedcoordinates2.html +130 -0
- data/closure-library/closure/goog/demos/graphics/basicelements.html +264 -0
- data/closure-library/closure/goog/demos/graphics/events.html +113 -0
- data/closure-library/closure/goog/demos/graphics/modifyelements.html +195 -0
- data/closure-library/closure/goog/demos/graphics/subpixel.html +80 -0
- data/closure-library/closure/goog/demos/graphics/tiger.html +105 -0
- data/closure-library/closure/goog/demos/graphics/tigerdata.js +2840 -0
- data/closure-library/closure/goog/demos/history1.html +132 -0
- data/closure-library/closure/goog/demos/history2.html +100 -0
- data/closure-library/closure/goog/demos/history3.html +106 -0
- data/closure-library/closure/goog/demos/history3js.html +36 -0
- data/closure-library/closure/goog/demos/history_blank.html +25 -0
- data/closure-library/closure/goog/demos/hovercard.html +177 -0
- data/closure-library/closure/goog/demos/hsvapalette.html +55 -0
- data/closure-library/closure/goog/demos/hsvpalette.html +56 -0
- data/closure-library/closure/goog/demos/html5history.html +87 -0
- data/closure-library/closure/goog/demos/imagelessbutton.html +221 -0
- data/closure-library/closure/goog/demos/imagelessmenubutton.html +285 -0
- data/closure-library/closure/goog/demos/imagelessroundedcorner.html +231 -0
- data/closure-library/closure/goog/demos/index.html +19 -0
- data/closure-library/closure/goog/demos/index_nav.html +253 -0
- data/closure-library/closure/goog/demos/index_splash.html +22 -0
- data/closure-library/closure/goog/demos/inline_block_quirks.html +125 -0
- data/closure-library/closure/goog/demos/inline_block_standards.html +126 -0
- data/closure-library/closure/goog/demos/inputdatepicker.html +60 -0
- data/closure-library/closure/goog/demos/inputhandler.html +72 -0
- data/closure-library/closure/goog/demos/jsonprettyprinter.html +80 -0
- data/closure-library/closure/goog/demos/keyboardshortcuts.html +112 -0
- data/closure-library/closure/goog/demos/keyhandler.html +127 -0
- data/closure-library/closure/goog/demos/labelinput.html +42 -0
- data/closure-library/closure/goog/demos/menu.html +220 -0
- data/closure-library/closure/goog/demos/menubutton.html +318 -0
- data/closure-library/closure/goog/demos/mousewheelhandler.html +109 -0
- data/closure-library/closure/goog/demos/offline.html +268 -0
- data/closure-library/closure/goog/demos/onlinehandler.html +77 -0
- data/closure-library/closure/goog/demos/palette.html +302 -0
- data/closure-library/closure/goog/demos/pastehandler.html +54 -0
- data/closure-library/closure/goog/demos/plaintextspellchecker.html +106 -0
- data/closure-library/closure/goog/demos/popup.html +200 -0
- data/closure-library/closure/goog/demos/popupcolorpicker.html +49 -0
- data/closure-library/closure/goog/demos/popupdatepicker.html +53 -0
- data/closure-library/closure/goog/demos/popupemojipicker.html +407 -0
- data/closure-library/closure/goog/demos/popupmenu.html +89 -0
- data/closure-library/closure/goog/demos/progressbar.html +97 -0
- data/closure-library/closure/goog/demos/prompt.html +92 -0
- data/closure-library/closure/goog/demos/quadtree.html +107 -0
- data/closure-library/closure/goog/demos/ratings.html +120 -0
- data/closure-library/closure/goog/demos/richtextspellchecker.html +92 -0
- data/closure-library/closure/goog/demos/roundedpanel.html +139 -0
- data/closure-library/closure/goog/demos/samplecomponent.html +75 -0
- data/closure-library/closure/goog/demos/samplecomponent.js +206 -0
- data/closure-library/closure/goog/demos/scrollfloater.html +117 -0
- data/closure-library/closure/goog/demos/select.html +324 -0
- data/closure-library/closure/goog/demos/selectionmenubutton.html +186 -0
- data/closure-library/closure/goog/demos/serverchart.html +122 -0
- data/closure-library/closure/goog/demos/silverlightclipboardbutton.html +71 -0
- data/closure-library/closure/goog/demos/slider.html +110 -0
- data/closure-library/closure/goog/demos/splitbehavior.html +164 -0
- data/closure-library/closure/goog/demos/splitpane.html +243 -0
- data/closure-library/closure/goog/demos/stopevent.html +171 -0
- data/closure-library/closure/goog/demos/submenus.html +130 -0
- data/closure-library/closure/goog/demos/submenus2.html +150 -0
- data/closure-library/closure/goog/demos/tabbar.html +289 -0
- data/closure-library/closure/goog/demos/tablesorter.html +116 -0
- data/closure-library/closure/goog/demos/tabpane.html +302 -0
- data/closure-library/closure/goog/demos/textarea.html +128 -0
- data/closure-library/closure/goog/demos/timers.html +291 -0
- data/closure-library/closure/goog/demos/toolbar.html +703 -0
- data/closure-library/closure/goog/demos/tooltip.html +91 -0
- data/closure-library/closure/goog/demos/tracer.html +92 -0
- data/closure-library/closure/goog/demos/tree/demo.html +126 -0
- data/closure-library/closure/goog/demos/tree/testdata.js +260 -0
- data/closure-library/closure/goog/demos/tweakui.html +121 -0
- data/closure-library/closure/goog/demos/twothumbslider.html +121 -0
- data/closure-library/closure/goog/demos/useragent.html +173 -0
- data/closure-library/closure/goog/demos/viewportsizemonitor.html +71 -0
- data/closure-library/closure/goog/demos/xpc/blank.html +7 -0
- data/closure-library/closure/goog/demos/xpc/index.html +89 -0
- data/closure-library/closure/goog/demos/xpc/inner.html +58 -0
- data/closure-library/closure/goog/demos/xpc/minimal/blank.html +7 -0
- data/closure-library/closure/goog/demos/xpc/minimal/index.html +105 -0
- data/closure-library/closure/goog/demos/xpc/minimal/inner.html +75 -0
- data/closure-library/closure/goog/demos/xpc/minimal/relay.html +7 -0
- data/closure-library/closure/goog/demos/xpc/relay.html +7 -0
- data/closure-library/closure/goog/demos/xpc/xpcdemo.js +304 -0
- data/closure-library/closure/goog/demos/zippy.html +127 -0
- data/closure-library/closure/goog/deps.js +672 -0
- data/closure-library/closure/goog/disposable/disposable.js +167 -0
- data/closure-library/closure/goog/disposable/disposable_test.html +202 -0
- data/closure-library/closure/goog/dom/a11y.js +438 -0
- data/closure-library/closure/goog/dom/a11y_test.html +86 -0
- data/closure-library/closure/goog/dom/abstractmultirange.js +77 -0
- data/closure-library/closure/goog/dom/abstractrange.js +514 -0
- data/closure-library/closure/goog/dom/abstractrange_test.html +73 -0
- data/closure-library/closure/goog/dom/annotate.js +352 -0
- data/closure-library/closure/goog/dom/annotate_test.html +187 -0
- data/closure-library/closure/goog/dom/browserfeature.js +50 -0
- data/closure-library/closure/goog/dom/browserrange/abstractrange.js +316 -0
- data/closure-library/closure/goog/dom/browserrange/browserrange.js +149 -0
- data/closure-library/closure/goog/dom/browserrange/browserrange_test.html +562 -0
- data/closure-library/closure/goog/dom/browserrange/geckorange.js +82 -0
- data/closure-library/closure/goog/dom/browserrange/ierange.js +970 -0
- data/closure-library/closure/goog/dom/browserrange/operarange.js +83 -0
- data/closure-library/closure/goog/dom/browserrange/w3crange.js +364 -0
- data/closure-library/closure/goog/dom/browserrange/webkitrange.js +112 -0
- data/closure-library/closure/goog/dom/classes.js +233 -0
- data/closure-library/closure/goog/dom/classes_test.html +228 -0
- data/closure-library/closure/goog/dom/controlrange.js +511 -0
- data/closure-library/closure/goog/dom/controlrange_test.html +246 -0
- data/closure-library/closure/goog/dom/dataset.js +90 -0
- data/closure-library/closure/goog/dom/dataset_test.html +104 -0
- data/closure-library/closure/goog/dom/dom.js +2424 -0
- data/closure-library/closure/goog/dom/dom_quirks_test.html +104 -0
- data/closure-library/closure/goog/dom/dom_test.html +103 -0
- data/closure-library/closure/goog/dom/dom_test.js +1129 -0
- data/closure-library/closure/goog/dom/fontsizemonitor.js +159 -0
- data/closure-library/closure/goog/dom/fontsizemonitor_test.html +283 -0
- data/closure-library/closure/goog/dom/forms.js +403 -0
- data/closure-library/closure/goog/dom/forms_test.html +483 -0
- data/closure-library/closure/goog/dom/iframe.js +128 -0
- data/closure-library/closure/goog/dom/iframe_test.html +87 -0
- data/closure-library/closure/goog/dom/iter.js +127 -0
- data/closure-library/closure/goog/dom/iter_test.html +97 -0
- data/closure-library/closure/goog/dom/multirange.js +519 -0
- data/closure-library/closure/goog/dom/multirange_test.html +67 -0
- data/closure-library/closure/goog/dom/nodeiterator.js +85 -0
- data/closure-library/closure/goog/dom/nodeiterator_test.html +49 -0
- data/closure-library/closure/goog/dom/nodeoffset.js +111 -0
- data/closure-library/closure/goog/dom/nodeoffset_test.html +88 -0
- data/closure-library/closure/goog/dom/pattern/abstractpattern.js +60 -0
- data/closure-library/closure/goog/dom/pattern/allchildren.js +73 -0
- data/closure-library/closure/goog/dom/pattern/callback/callback.js +82 -0
- data/closure-library/closure/goog/dom/pattern/callback/counter.js +72 -0
- data/closure-library/closure/goog/dom/pattern/callback/test.js +77 -0
- data/closure-library/closure/goog/dom/pattern/childmatches.js +152 -0
- data/closure-library/closure/goog/dom/pattern/endtag.js +53 -0
- data/closure-library/closure/goog/dom/pattern/fulltag.js +92 -0
- data/closure-library/closure/goog/dom/pattern/matcher.js +150 -0
- data/closure-library/closure/goog/dom/pattern/matcher_test.html +204 -0
- data/closure-library/closure/goog/dom/pattern/nodetype.js +57 -0
- data/closure-library/closure/goog/dom/pattern/pattern.js +93 -0
- data/closure-library/closure/goog/dom/pattern/pattern_test.html +614 -0
- data/closure-library/closure/goog/dom/pattern/repeat.js +188 -0
- data/closure-library/closure/goog/dom/pattern/sequence.js +139 -0
- data/closure-library/closure/goog/dom/pattern/starttag.js +53 -0
- data/closure-library/closure/goog/dom/pattern/tag.js +149 -0
- data/closure-library/closure/goog/dom/pattern/text.js +69 -0
- data/closure-library/closure/goog/dom/range.js +220 -0
- data/closure-library/closure/goog/dom/range_test.html +702 -0
- data/closure-library/closure/goog/dom/rangeendpoint.js +32 -0
- data/closure-library/closure/goog/dom/savedcaretrange.js +203 -0
- data/closure-library/closure/goog/dom/savedcaretrange_test.html +235 -0
- data/closure-library/closure/goog/dom/savedrange.js +74 -0
- data/closure-library/closure/goog/dom/savedrange_test.html +61 -0
- data/closure-library/closure/goog/dom/selection.js +470 -0
- data/closure-library/closure/goog/dom/selection_test.html +329 -0
- data/closure-library/closure/goog/dom/tagiterator.js +365 -0
- data/closure-library/closure/goog/dom/tagiterator_test.html +589 -0
- data/closure-library/closure/goog/dom/tagname.js +121 -0
- data/closure-library/closure/goog/dom/tagname_test.html +37 -0
- data/closure-library/closure/goog/dom/textrange.js +611 -0
- data/closure-library/closure/goog/dom/textrange_test.html +127 -0
- data/closure-library/closure/goog/dom/textrangeiterator.js +246 -0
- data/closure-library/closure/goog/dom/textrangeiterator_test.html +142 -0
- data/closure-library/closure/goog/dom/viewportsizemonitor.js +220 -0
- data/closure-library/closure/goog/dom/viewportsizemonitor_test.html +166 -0
- data/closure-library/closure/goog/dom/xml.js +187 -0
- data/closure-library/closure/goog/dom/xml_test.html +77 -0
- data/closure-library/closure/goog/editor/browserfeature.js +251 -0
- data/closure-library/closure/goog/editor/browserfeature_test.html +124 -0
- data/closure-library/closure/goog/editor/clicktoeditwrapper.js +438 -0
- data/closure-library/closure/goog/editor/clicktoeditwrapper_test.html +137 -0
- data/closure-library/closure/goog/editor/command.js +74 -0
- data/closure-library/closure/goog/editor/defines.js +34 -0
- data/closure-library/closure/goog/editor/field.js +2594 -0
- data/closure-library/closure/goog/editor/field_test.html +1000 -0
- data/closure-library/closure/goog/editor/focus.js +32 -0
- data/closure-library/closure/goog/editor/focus_test.html +66 -0
- data/closure-library/closure/goog/editor/icontent.js +296 -0
- data/closure-library/closure/goog/editor/icontent_test.html +209 -0
- data/closure-library/closure/goog/editor/link.js +279 -0
- data/closure-library/closure/goog/editor/link_test.html +234 -0
- data/closure-library/closure/goog/editor/node.js +435 -0
- data/closure-library/closure/goog/editor/node_test.html +590 -0
- data/closure-library/closure/goog/editor/plugin.js +444 -0
- data/closure-library/closure/goog/editor/plugin_test.html +187 -0
- data/closure-library/closure/goog/editor/plugins/abstractbubbleplugin.js +535 -0
- data/closure-library/closure/goog/editor/plugins/abstractbubbleplugin_test.html +227 -0
- data/closure-library/closure/goog/editor/plugins/abstractdialogplugin.js +336 -0
- data/closure-library/closure/goog/editor/plugins/abstractdialogplugin_test.html +399 -0
- data/closure-library/closure/goog/editor/plugins/abstracttabhandler.js +78 -0
- data/closure-library/closure/goog/editor/plugins/abstracttabhandler_test.html +91 -0
- data/closure-library/closure/goog/editor/plugins/basictextformatter.js +1740 -0
- data/closure-library/closure/goog/editor/plugins/basictextformatter_test.html +1171 -0
- data/closure-library/closure/goog/editor/plugins/blockquote.js +422 -0
- data/closure-library/closure/goog/editor/plugins/blockquote_test.html +149 -0
- data/closure-library/closure/goog/editor/plugins/emoticons.js +83 -0
- data/closure-library/closure/goog/editor/plugins/emoticons_test.html +67 -0
- data/closure-library/closure/goog/editor/plugins/enterhandler.js +730 -0
- data/closure-library/closure/goog/editor/plugins/enterhandler_test.html +739 -0
- data/closure-library/closure/goog/editor/plugins/headerformatter.js +95 -0
- data/closure-library/closure/goog/editor/plugins/headerformatter_test.html +100 -0
- data/closure-library/closure/goog/editor/plugins/linkbubble.js +458 -0
- data/closure-library/closure/goog/editor/plugins/linkbubble_test.html +309 -0
- data/closure-library/closure/goog/editor/plugins/linkdialogplugin.js +222 -0
- data/closure-library/closure/goog/editor/plugins/linkdialogplugin_test.html +370 -0
- data/closure-library/closure/goog/editor/plugins/listtabhandler.js +66 -0
- data/closure-library/closure/goog/editor/plugins/listtabhandler_test.html +177 -0
- data/closure-library/closure/goog/editor/plugins/loremipsum.js +186 -0
- data/closure-library/closure/goog/editor/plugins/loremipsum_test.html +169 -0
- data/closure-library/closure/goog/editor/plugins/removeformatting.js +772 -0
- data/closure-library/closure/goog/editor/plugins/removeformatting_test.html +920 -0
- data/closure-library/closure/goog/editor/plugins/spacestabhandler.js +93 -0
- data/closure-library/closure/goog/editor/plugins/spacestabhandler_test.html +186 -0
- data/closure-library/closure/goog/editor/plugins/tableeditor.js +496 -0
- data/closure-library/closure/goog/editor/plugins/tableeditor_test.html +299 -0
- data/closure-library/closure/goog/editor/plugins/tagonenterhandler.js +741 -0
- data/closure-library/closure/goog/editor/plugins/tagonenterhandler_test.html +481 -0
- data/closure-library/closure/goog/editor/plugins/undoredo.js +1014 -0
- data/closure-library/closure/goog/editor/plugins/undoredo_test.html +525 -0
- data/closure-library/closure/goog/editor/plugins/undoredomanager.js +337 -0
- data/closure-library/closure/goog/editor/plugins/undoredomanager_test.html +394 -0
- data/closure-library/closure/goog/editor/plugins/undoredostate.js +84 -0
- data/closure-library/closure/goog/editor/plugins/undoredostate_test.html +44 -0
- data/closure-library/closure/goog/editor/range.js +602 -0
- data/closure-library/closure/goog/editor/range_test.html +880 -0
- data/closure-library/closure/goog/editor/seamlessfield.js +720 -0
- data/closure-library/closure/goog/editor/seamlessfield_quirks_test.html +30 -0
- data/closure-library/closure/goog/editor/seamlessfield_test.html +33 -0
- data/closure-library/closure/goog/editor/seamlessfield_test.js +392 -0
- data/closure-library/closure/goog/editor/style.js +222 -0
- data/closure-library/closure/goog/editor/style_test.html +177 -0
- data/closure-library/closure/goog/editor/table.js +566 -0
- data/closure-library/closure/goog/editor/table_test.html +522 -0
- data/closure-library/closure/goog/events/actioneventwrapper.js +131 -0
- data/closure-library/closure/goog/events/actioneventwrapper_test.html +176 -0
- data/closure-library/closure/goog/events/actionhandler.js +189 -0
- data/closure-library/closure/goog/events/actionhandler_test.html +82 -0
- data/closure-library/closure/goog/events/browserevent.js +412 -0
- data/closure-library/closure/goog/events/browserevent_test.html +145 -0
- data/closure-library/closure/goog/events/browserfeature.js +43 -0
- data/closure-library/closure/goog/events/event.js +123 -0
- data/closure-library/closure/goog/events/event_test.html +70 -0
- data/closure-library/closure/goog/events/eventhandler.js +348 -0
- data/closure-library/closure/goog/events/eventhandler_test.html +230 -0
- data/closure-library/closure/goog/events/events.js +1101 -0
- data/closure-library/closure/goog/events/events_test.html +362 -0
- data/closure-library/closure/goog/events/eventtarget.js +197 -0
- data/closure-library/closure/goog/events/eventtarget_test.html +423 -0
- data/closure-library/closure/goog/events/eventtype.js +107 -0
- data/closure-library/closure/goog/events/eventwrapper.js +67 -0
- data/closure-library/closure/goog/events/filedrophandler.js +224 -0
- data/closure-library/closure/goog/events/filedrophandler_test.html +258 -0
- data/closure-library/closure/goog/events/focushandler.js +111 -0
- data/closure-library/closure/goog/events/imehandler.js +365 -0
- data/closure-library/closure/goog/events/imehandler_test.html +271 -0
- data/closure-library/closure/goog/events/inputhandler.js +218 -0
- data/closure-library/closure/goog/events/keycodes.js +314 -0
- data/closure-library/closure/goog/events/keycodes_test.html +72 -0
- data/closure-library/closure/goog/events/keyhandler.js +522 -0
- data/closure-library/closure/goog/events/keyhandler_test.html +621 -0
- data/closure-library/closure/goog/events/keynames.js +124 -0
- data/closure-library/closure/goog/events/listener.js +160 -0
- data/closure-library/closure/goog/events/mousewheelhandler.js +280 -0
- data/closure-library/closure/goog/events/mousewheelhandler_test.html +331 -0
- data/closure-library/closure/goog/events/onlinehandler.js +176 -0
- data/closure-library/closure/goog/events/onlinelistener_test.html +214 -0
- data/closure-library/closure/goog/events/pastehandler.js +444 -0
- data/closure-library/closure/goog/events/pastehandler_test.html +354 -0
- data/closure-library/closure/goog/events/pools.js +342 -0
- data/closure-library/closure/goog/format/emailaddress.js +329 -0
- data/closure-library/closure/goog/format/emailaddress_test.html +179 -0
- data/closure-library/closure/goog/format/format.js +451 -0
- data/closure-library/closure/goog/format/format_test.html +257 -0
- data/closure-library/closure/goog/format/htmlprettyprinter.js +406 -0
- data/closure-library/closure/goog/format/htmlprettyprinter_test.html +205 -0
- data/closure-library/closure/goog/format/jsonprettyprinter.js +405 -0
- data/closure-library/closure/goog/format/jsonprettyprinter_test.html +111 -0
- data/closure-library/closure/goog/fs/entry.js +406 -0
- data/closure-library/closure/goog/fs/error.js +103 -0
- data/closure-library/closure/goog/fs/filesaver.js +214 -0
- data/closure-library/closure/goog/fs/filesystem.js +59 -0
- data/closure-library/closure/goog/fs/filewriter.js +106 -0
- data/closure-library/closure/goog/fs/fs.js +183 -0
- data/closure-library/closure/goog/fs/fs_test.html +270 -0
- data/closure-library/closure/goog/functions/functions.js +219 -0
- data/closure-library/closure/goog/functions/functions_test.html +198 -0
- data/closure-library/closure/goog/fx/abstractdragdrop.js +1451 -0
- data/closure-library/closure/goog/fx/abstractdragdrop_test.html +430 -0
- data/closure-library/closure/goog/fx/animation.js +621 -0
- data/closure-library/closure/goog/fx/animationqueue.js +348 -0
- data/closure-library/closure/goog/fx/cssspriteanimation.js +112 -0
- data/closure-library/closure/goog/fx/cssspriteanimation_test.html +125 -0
- data/closure-library/closure/goog/fx/dom.js +610 -0
- data/closure-library/closure/goog/fx/dragdrop.js +49 -0
- data/closure-library/closure/goog/fx/dragdropgroup.js +107 -0
- data/closure-library/closure/goog/fx/dragdropgroup_test.html +234 -0
- data/closure-library/closure/goog/fx/dragger.js +731 -0
- data/closure-library/closure/goog/fx/dragger_test.html +415 -0
- data/closure-library/closure/goog/fx/draglistgroup.js +1159 -0
- data/closure-library/closure/goog/fx/draglistgroup_test.html +231 -0
- data/closure-library/closure/goog/fx/dragscrollsupport.js +274 -0
- data/closure-library/closure/goog/fx/dragscrollsupport_test.html +253 -0
- data/closure-library/closure/goog/fx/easing.js +50 -0
- data/closure-library/closure/goog/fx/fx.js +30 -0
- data/closure-library/closure/goog/fx/fx_test.html +157 -0
- data/closure-library/closure/goog/gears/basestore.js +523 -0
- data/closure-library/closure/goog/gears/basestore_test.html +247 -0
- data/closure-library/closure/goog/gears/database.js +935 -0
- data/closure-library/closure/goog/gears/database_test.html +699 -0
- data/closure-library/closure/goog/gears/fakeworkerpool.js +252 -0
- data/closure-library/closure/goog/gears/fakeworkerpool_test.html +188 -0
- data/closure-library/closure/goog/gears/gears.js +228 -0
- data/closure-library/closure/goog/gears/gears_test.html +78 -0
- data/closure-library/closure/goog/gears/httprequest.js +77 -0
- data/closure-library/closure/goog/gears/loggerclient.js +131 -0
- data/closure-library/closure/goog/gears/loggerclient_test.html +171 -0
- data/closure-library/closure/goog/gears/loggerserver.js +158 -0
- data/closure-library/closure/goog/gears/loggerserver_test.html +118 -0
- data/closure-library/closure/goog/gears/logstore.js +479 -0
- data/closure-library/closure/goog/gears/logstore_test.html +600 -0
- data/closure-library/closure/goog/gears/managedresourcestore.js +553 -0
- data/closure-library/closure/goog/gears/managedresourcestore_test.html +453 -0
- data/closure-library/closure/goog/gears/multipartformdata.js +203 -0
- data/closure-library/closure/goog/gears/multipartformdata_test.html +220 -0
- data/closure-library/closure/goog/gears/statustype.js +37 -0
- data/closure-library/closure/goog/gears/urlcapture.js +370 -0
- data/closure-library/closure/goog/gears/urlcapture_test.html +392 -0
- data/closure-library/closure/goog/gears/worker.js +201 -0
- data/closure-library/closure/goog/gears/workerchannel.js +205 -0
- data/closure-library/closure/goog/gears/workerchannel_test.html +207 -0
- data/closure-library/closure/goog/gears/workerpool.js +241 -0
- data/closure-library/closure/goog/gears/workerpool_test.html +203 -0
- data/closure-library/closure/goog/graphics/abstractgraphics.js +439 -0
- data/closure-library/closure/goog/graphics/affinetransform.js +497 -0
- data/closure-library/closure/goog/graphics/affinetransform_test.html +316 -0
- data/closure-library/closure/goog/graphics/canvaselement.js +776 -0
- data/closure-library/closure/goog/graphics/canvasgraphics.js +632 -0
- data/closure-library/closure/goog/graphics/element.js +145 -0
- data/closure-library/closure/goog/graphics/ellipseelement.js +59 -0
- data/closure-library/closure/goog/graphics/ext/coordinates.js +158 -0
- data/closure-library/closure/goog/graphics/ext/coordinates_test.html +74 -0
- data/closure-library/closure/goog/graphics/ext/element.js +970 -0
- data/closure-library/closure/goog/graphics/ext/element_test.html +144 -0
- data/closure-library/closure/goog/graphics/ext/ellipse.js +58 -0
- data/closure-library/closure/goog/graphics/ext/ext.js +29 -0
- data/closure-library/closure/goog/graphics/ext/graphics.js +209 -0
- data/closure-library/closure/goog/graphics/ext/group.js +213 -0
- data/closure-library/closure/goog/graphics/ext/image.js +62 -0
- data/closure-library/closure/goog/graphics/ext/path.js +140 -0
- data/closure-library/closure/goog/graphics/ext/path_test.html +46 -0
- data/closure-library/closure/goog/graphics/ext/rectangle.js +53 -0
- data/closure-library/closure/goog/graphics/ext/shape.js +144 -0
- data/closure-library/closure/goog/graphics/ext/strokeandfillelement.js +69 -0
- data/closure-library/closure/goog/graphics/fill.js +29 -0
- data/closure-library/closure/goog/graphics/font.js +59 -0
- data/closure-library/closure/goog/graphics/graphics.js +124 -0
- data/closure-library/closure/goog/graphics/groupelement.js +54 -0
- data/closure-library/closure/goog/graphics/imageelement.js +67 -0
- data/closure-library/closure/goog/graphics/lineargradient.js +131 -0
- data/closure-library/closure/goog/graphics/path.js +508 -0
- data/closure-library/closure/goog/graphics/path_test.html +359 -0
- data/closure-library/closure/goog/graphics/pathelement.js +50 -0
- data/closure-library/closure/goog/graphics/paths.js +86 -0
- data/closure-library/closure/goog/graphics/paths_test.html +97 -0
- data/closure-library/closure/goog/graphics/rectelement.js +59 -0
- data/closure-library/closure/goog/graphics/solidfill.js +70 -0
- data/closure-library/closure/goog/graphics/stroke.js +63 -0
- data/closure-library/closure/goog/graphics/strokeandfillelement.js +110 -0
- data/closure-library/closure/goog/graphics/svgelement.js +262 -0
- data/closure-library/closure/goog/graphics/svggraphics.js +813 -0
- data/closure-library/closure/goog/graphics/textelement.js +51 -0
- data/closure-library/closure/goog/graphics/vmlelement.js +380 -0
- data/closure-library/closure/goog/graphics/vmlgraphics.js +863 -0
- data/closure-library/closure/goog/history/event.js +54 -0
- data/closure-library/closure/goog/history/eventtype.js +30 -0
- data/closure-library/closure/goog/history/history.js +979 -0
- data/closure-library/closure/goog/history/html5history.js +303 -0
- data/closure-library/closure/goog/history/html5history_test.html +163 -0
- data/closure-library/closure/goog/i18n/bidi.js +772 -0
- data/closure-library/closure/goog/i18n/bidi_test.html +414 -0
- data/closure-library/closure/goog/i18n/bidiformatter.js +488 -0
- data/closure-library/closure/goog/i18n/bidiformatter_test.html +343 -0
- data/closure-library/closure/goog/i18n/charlistdecompressor.js +157 -0
- data/closure-library/closure/goog/i18n/charlistdecompressor_test.html +65 -0
- data/closure-library/closure/goog/i18n/charpickerdata.js +3185 -0
- data/closure-library/closure/goog/i18n/currency.js +385 -0
- data/closure-library/closure/goog/i18n/currency_test.html +202 -0
- data/closure-library/closure/goog/i18n/currencycodemap.js +210 -0
- data/closure-library/closure/goog/i18n/datetimeformat.js +636 -0
- data/closure-library/closure/goog/i18n/datetimeformat_test.html +436 -0
- data/closure-library/closure/goog/i18n/datetimeparse.js +1111 -0
- data/closure-library/closure/goog/i18n/datetimeparse_test.html +796 -0
- data/closure-library/closure/goog/i18n/datetimepatterns.js +1586 -0
- data/closure-library/closure/goog/i18n/datetimepatternsext.js +7386 -0
- data/closure-library/closure/goog/i18n/datetimesymbols.js +3350 -0
- data/closure-library/closure/goog/i18n/datetimesymbolsext.js +12938 -0
- data/closure-library/closure/goog/i18n/graphemebreak.js +181 -0
- data/closure-library/closure/goog/i18n/graphemebreak_test.html +72 -0
- data/closure-library/closure/goog/i18n/messageformat.js +553 -0
- data/closure-library/closure/goog/i18n/messageformat_test.html +323 -0
- data/closure-library/closure/goog/i18n/mime.js +100 -0
- data/closure-library/closure/goog/i18n/mime_test.html +51 -0
- data/closure-library/closure/goog/i18n/numberformat.js +763 -0
- data/closure-library/closure/goog/i18n/numberformat_test.html +605 -0
- data/closure-library/closure/goog/i18n/numberformatsymbols.js +10358 -0
- data/closure-library/closure/goog/i18n/pluralrules.js +695 -0
- data/closure-library/closure/goog/i18n/timezone.js +341 -0
- data/closure-library/closure/goog/i18n/timezone_test.html +163 -0
- data/closure-library/closure/goog/i18n/uchar.js +1160 -0
- data/closure-library/closure/goog/i18n/uchar_test.html +72 -0
- data/closure-library/closure/goog/images/blank.gif +0 -0
- data/closure-library/closure/goog/images/bubble_close.jpg +0 -0
- data/closure-library/closure/goog/images/bubble_left.gif +0 -0
- data/closure-library/closure/goog/images/bubble_right.gif +0 -0
- data/closure-library/closure/goog/images/button-bg.gif +0 -0
- data/closure-library/closure/goog/images/check-outline.gif +0 -0
- data/closure-library/closure/goog/images/check-sprite.gif +0 -0
- data/closure-library/closure/goog/images/check.gif +0 -0
- data/closure-library/closure/goog/images/close_box.gif +0 -0
- data/closure-library/closure/goog/images/color-swatch-tick.gif +0 -0
- data/closure-library/closure/goog/images/dialog_close_box.gif +0 -0
- data/closure-library/closure/goog/images/dimension-highlighted.png +0 -0
- data/closure-library/closure/goog/images/dimension-unhighlighted.png +0 -0
- data/closure-library/closure/goog/images/dropdn.gif +0 -0
- data/closure-library/closure/goog/images/dropdn_disabled.gif +0 -0
- data/closure-library/closure/goog/images/dropdown.gif +0 -0
- data/closure-library/closure/goog/images/gears_bluedot.gif +0 -0
- data/closure-library/closure/goog/images/gears_offline.gif +0 -0
- data/closure-library/closure/goog/images/gears_online.gif +0 -0
- data/closure-library/closure/goog/images/gears_paused.gif +0 -0
- data/closure-library/closure/goog/images/gears_syncing.gif +0 -0
- data/closure-library/closure/goog/images/hsv-sprite-sm.gif +0 -0
- data/closure-library/closure/goog/images/hsv-sprite-sm.png +0 -0
- data/closure-library/closure/goog/images/hsv-sprite.gif +0 -0
- data/closure-library/closure/goog/images/hsv-sprite.png +0 -0
- data/closure-library/closure/goog/images/hsva-sprite-sm.gif +0 -0
- data/closure-library/closure/goog/images/hsva-sprite-sm.png +0 -0
- data/closure-library/closure/goog/images/hsva-sprite.gif +0 -0
- data/closure-library/closure/goog/images/hsva-sprite.png +0 -0
- data/closure-library/closure/goog/images/left_anchor_bubble_bot.gif +0 -0
- data/closure-library/closure/goog/images/left_anchor_bubble_top.gif +0 -0
- data/closure-library/closure/goog/images/menu-arrows.gif +0 -0
- data/closure-library/closure/goog/images/minus.png +0 -0
- data/closure-library/closure/goog/images/no_anchor_bubble_bot.gif +0 -0
- data/closure-library/closure/goog/images/no_anchor_bubble_top.gif +0 -0
- data/closure-library/closure/goog/images/offlineicons.png +0 -0
- data/closure-library/closure/goog/images/plus.png +0 -0
- data/closure-library/closure/goog/images/ratingstars.gif +0 -0
- data/closure-library/closure/goog/images/right_anchor_bubble_bot.gif +0 -0
- data/closure-library/closure/goog/images/right_anchor_bubble_top.gif +0 -0
- data/closure-library/closure/goog/images/toolbar-bg.png +0 -0
- data/closure-library/closure/goog/images/toolbar-separator.gif +0 -0
- data/closure-library/closure/goog/images/toolbar_icons.gif +0 -0
- data/closure-library/closure/goog/images/tree/I.png +0 -0
- data/closure-library/closure/goog/images/tree/cleardot.gif +0 -0
- data/closure-library/closure/goog/images/tree/tree.gif +0 -0
- data/closure-library/closure/goog/images/tree/tree.png +0 -0
- data/closure-library/closure/goog/images/ui_controls.jpg +0 -0
- data/closure-library/closure/goog/iter/iter.js +627 -0
- data/closure-library/closure/goog/iter/iter_test.html +443 -0
- data/closure-library/closure/goog/json/json.js +302 -0
- data/closure-library/closure/goog/json/json_test.html +501 -0
- data/closure-library/closure/goog/locale/countries.js +288 -0
- data/closure-library/closure/goog/locale/countrylanguagenames_test.html +233 -0
- data/closure-library/closure/goog/locale/defaultlocalenameconstants.js +847 -0
- data/closure-library/closure/goog/locale/genericfontnames.js +73 -0
- data/closure-library/closure/goog/locale/genericfontnames_test.html +97 -0
- data/closure-library/closure/goog/locale/genericfontnamesdata.js +328 -0
- data/closure-library/closure/goog/locale/locale.js +397 -0
- data/closure-library/closure/goog/locale/nativenameconstants.js +1354 -0
- data/closure-library/closure/goog/locale/scriptToLanguages.js +482 -0
- data/closure-library/closure/goog/locale/timezonedetection.js +117 -0
- data/closure-library/closure/goog/locale/timezonedetection_test.html +130 -0
- data/closure-library/closure/goog/locale/timezonefingerprint.js +250 -0
- data/closure-library/closure/goog/locale/timezonelist.js +129 -0
- data/closure-library/closure/goog/locale/timezonelist_test.html +165 -0
- data/closure-library/closure/goog/math/bezier.js +244 -0
- data/closure-library/closure/goog/math/bezier_test.html +70 -0
- data/closure-library/closure/goog/math/box.js +236 -0
- data/closure-library/closure/goog/math/box_test.html +139 -0
- data/closure-library/closure/goog/math/coordinate.js +136 -0
- data/closure-library/closure/goog/math/coordinate3.js +168 -0
- data/closure-library/closure/goog/math/coordinate3_test.html +208 -0
- data/closure-library/closure/goog/math/coordinate_test.html +92 -0
- data/closure-library/closure/goog/math/integer.js +736 -0
- data/closure-library/closure/goog/math/integer_test.html +1653 -0
- data/closure-library/closure/goog/math/line.js +177 -0
- data/closure-library/closure/goog/math/line_test.html +62 -0
- data/closure-library/closure/goog/math/long.js +801 -0
- data/closure-library/closure/goog/math/long_test.html +1571 -0
- data/closure-library/closure/goog/math/math.js +355 -0
- data/closure-library/closure/goog/math/math_test.html +254 -0
- data/closure-library/closure/goog/math/matrix.js +669 -0
- data/closure-library/closure/goog/math/matrix_test.html +427 -0
- data/closure-library/closure/goog/math/range.js +146 -0
- data/closure-library/closure/goog/math/range_test.html +103 -0
- data/closure-library/closure/goog/math/rangeset.js +368 -0
- data/closure-library/closure/goog/math/rangeset_test.html +619 -0
- data/closure-library/closure/goog/math/rect.js +340 -0
- data/closure-library/closure/goog/math/rect_test.html +315 -0
- data/closure-library/closure/goog/math/size.js +201 -0
- data/closure-library/closure/goog/math/size_test.html +174 -0
- data/closure-library/closure/goog/math/vec2.js +255 -0
- data/closure-library/closure/goog/math/vec2_test.html +203 -0
- data/closure-library/closure/goog/math/vec3.js +327 -0
- data/closure-library/closure/goog/math/vec3_test.html +231 -0
- data/closure-library/closure/goog/memoize/memoize.js +98 -0
- data/closure-library/closure/goog/memoize/memoize_test.html +157 -0
- data/closure-library/closure/goog/messaging/abstractchannel.js +209 -0
- data/closure-library/closure/goog/messaging/abstractchannel_test.html +90 -0
- data/closure-library/closure/goog/messaging/bufferedchannel.js +277 -0
- data/closure-library/closure/goog/messaging/bufferedchannel_test.html +205 -0
- data/closure-library/closure/goog/messaging/deferredchannel.js +79 -0
- data/closure-library/closure/goog/messaging/deferredchannel_test.html +107 -0
- data/closure-library/closure/goog/messaging/loggerclient.js +131 -0
- data/closure-library/closure/goog/messaging/loggerclient_test.html +102 -0
- data/closure-library/closure/goog/messaging/loggerserver.js +94 -0
- data/closure-library/closure/goog/messaging/loggerserver_test.html +101 -0
- data/closure-library/closure/goog/messaging/messagechannel.js +115 -0
- data/closure-library/closure/goog/messaging/messaging.js +34 -0
- data/closure-library/closure/goog/messaging/messaging_test.html +42 -0
- data/closure-library/closure/goog/messaging/multichannel.js +303 -0
- data/closure-library/closure/goog/messaging/multichannel_test.html +122 -0
- data/closure-library/closure/goog/messaging/portchannel.js +341 -0
- data/closure-library/closure/goog/messaging/portchannel_test.html +359 -0
- data/closure-library/closure/goog/messaging/testdata/portchannel_worker.js +37 -0
- data/closure-library/closure/goog/module/abstractmoduleloader.js +46 -0
- data/closure-library/closure/goog/module/basemodule.js +45 -0
- data/closure-library/closure/goog/module/basemoduleloader.js +210 -0
- data/closure-library/closure/goog/module/loader.js +269 -0
- data/closure-library/closure/goog/module/module.js +166 -0
- data/closure-library/closure/goog/module/moduleinfo.js +336 -0
- data/closure-library/closure/goog/module/moduleinfo_test.html +109 -0
- data/closure-library/closure/goog/module/moduleloadcallback.js +84 -0
- data/closure-library/closure/goog/module/moduleloadcallback_test.html +57 -0
- data/closure-library/closure/goog/module/moduleloader.js +250 -0
- data/closure-library/closure/goog/module/moduleloader_test.html +244 -0
- data/closure-library/closure/goog/module/modulemanager.js +1008 -0
- data/closure-library/closure/goog/module/modulemanager_test.html +1240 -0
- data/closure-library/closure/goog/module/testdata/modA_1.js +22 -0
- data/closure-library/closure/goog/module/testdata/modA_2.js +24 -0
- data/closure-library/closure/goog/module/testdata/modB_1.js +24 -0
- data/closure-library/closure/goog/net/browserchannel.js +2441 -0
- data/closure-library/closure/goog/net/browserchannel_test.html +1176 -0
- data/closure-library/closure/goog/net/browsertestchannel.js +552 -0
- data/closure-library/closure/goog/net/bulkloader.js +174 -0
- data/closure-library/closure/goog/net/bulkloader_test.html +232 -0
- data/closure-library/closure/goog/net/bulkloaderhelper.js +129 -0
- data/closure-library/closure/goog/net/channeldebug.js +288 -0
- data/closure-library/closure/goog/net/channelrequest.js +1125 -0
- data/closure-library/closure/goog/net/channelrequest_test.html +158 -0
- data/closure-library/closure/goog/net/cookies.js +401 -0
- data/closure-library/closure/goog/net/cookies_test.html +255 -0
- data/closure-library/closure/goog/net/crossdomainrpc.js +848 -0
- data/closure-library/closure/goog/net/crossdomainrpc_test.gif +0 -0
- data/closure-library/closure/goog/net/crossdomainrpc_test.html +120 -0
- data/closure-library/closure/goog/net/crossdomainrpc_test_response.html +59 -0
- data/closure-library/closure/goog/net/errorcode.js +130 -0
- data/closure-library/closure/goog/net/eventtype.js +37 -0
- data/closure-library/closure/goog/net/iframe_xhr_test.html +142 -0
- data/closure-library/closure/goog/net/iframe_xhr_test_response.html +17 -0
- data/closure-library/closure/goog/net/iframeio.js +1342 -0
- data/closure-library/closure/goog/net/iframeio_different_base_test.data +2 -0
- data/closure-library/closure/goog/net/iframeio_different_base_test.html +42 -0
- data/closure-library/closure/goog/net/iframeio_test.html +368 -0
- data/closure-library/closure/goog/net/iframeloadmonitor.js +199 -0
- data/closure-library/closure/goog/net/iframeloadmonitor_test.html +113 -0
- data/closure-library/closure/goog/net/iframeloadmonitor_test_frame.html +12 -0
- data/closure-library/closure/goog/net/iframeloadmonitor_test_frame2.html +12 -0
- data/closure-library/closure/goog/net/iframeloadmonitor_test_frame3.html +12 -0
- data/closure-library/closure/goog/net/imageloader.js +237 -0
- data/closure-library/closure/goog/net/imageloader_test.html +200 -0
- data/closure-library/closure/goog/net/imageloader_testimg1.gif +0 -0
- data/closure-library/closure/goog/net/imageloader_testimg2.gif +0 -0
- data/closure-library/closure/goog/net/imageloader_testimg3.gif +0 -0
- data/closure-library/closure/goog/net/jsonp.js +379 -0
- data/closure-library/closure/goog/net/jsonp_test.html +328 -0
- data/closure-library/closure/goog/net/mockiframeio.js +318 -0
- data/closure-library/closure/goog/net/mockxhrlite.js +34 -0
- data/closure-library/closure/goog/net/mockxhrlite_test.html +109 -0
- data/closure-library/closure/goog/net/multiiframeloadmonitor.js +116 -0
- data/closure-library/closure/goog/net/multiiframeloadmonitor_test.html +172 -0
- data/closure-library/closure/goog/net/networktester.js +383 -0
- data/closure-library/closure/goog/net/networktester_test.html +227 -0
- data/closure-library/closure/goog/net/tmpnetwork.js +168 -0
- data/closure-library/closure/goog/net/wrapperxmlhttpfactory.js +68 -0
- data/closure-library/closure/goog/net/xhrio.js +1093 -0
- data/closure-library/closure/goog/net/xhrio_test.html +603 -0
- data/closure-library/closure/goog/net/xhriopool.js +87 -0
- data/closure-library/closure/goog/net/xhrlite.js +119 -0
- data/closure-library/closure/goog/net/xhrlite_test.html +156 -0
- data/closure-library/closure/goog/net/xhrlitepool.js +37 -0
- data/closure-library/closure/goog/net/xhrmanager.js +763 -0
- data/closure-library/closure/goog/net/xhrmonitor.js +254 -0
- data/closure-library/closure/goog/net/xhrmonitor_test.html +199 -0
- data/closure-library/closure/goog/net/xmlhttp.js +215 -0
- data/closure-library/closure/goog/net/xmlhttpfactory.js +64 -0
- data/closure-library/closure/goog/net/xpc/crosspagechannel.js +624 -0
- data/closure-library/closure/goog/net/xpc/crosspagechannel_test.html +422 -0
- data/closure-library/closure/goog/net/xpc/frameelementmethodtransport.js +251 -0
- data/closure-library/closure/goog/net/xpc/iframepollingtransport.js +822 -0
- data/closure-library/closure/goog/net/xpc/iframerelaytransport.js +288 -0
- data/closure-library/closure/goog/net/xpc/nativemessagingtransport.js +280 -0
- data/closure-library/closure/goog/net/xpc/nativemessagingtransport_test.html +164 -0
- data/closure-library/closure/goog/net/xpc/nixtransport.js +454 -0
- data/closure-library/closure/goog/net/xpc/relay.js +72 -0
- data/closure-library/closure/goog/net/xpc/testdata/inner_peer.html +106 -0
- data/closure-library/closure/goog/net/xpc/transport.js +104 -0
- data/closure-library/closure/goog/net/xpc/xpc.js +238 -0
- data/closure-library/closure/goog/object/object.js +553 -0
- data/closure-library/closure/goog/object/object_test.html +376 -0
- data/closure-library/closure/goog/positioning/absoluteposition.js +73 -0
- data/closure-library/closure/goog/positioning/abstractposition.js +47 -0
- data/closure-library/closure/goog/positioning/anchoredposition.js +78 -0
- data/closure-library/closure/goog/positioning/anchoredviewportposition.js +126 -0
- data/closure-library/closure/goog/positioning/anchoredviewportposition_test.html +117 -0
- data/closure-library/closure/goog/positioning/anchoredviewportposition_test_iframe.html +35 -0
- data/closure-library/closure/goog/positioning/clientposition.js +75 -0
- data/closure-library/closure/goog/positioning/menuanchoredposition.js +97 -0
- data/closure-library/closure/goog/positioning/positioning.js +476 -0
- data/closure-library/closure/goog/positioning/positioning_test.html +877 -0
- data/closure-library/closure/goog/positioning/positioning_test_iframe1.html +16 -0
- data/closure-library/closure/goog/positioning/positioning_test_iframe2.html +13 -0
- data/closure-library/closure/goog/positioning/positioning_test_quirk.html +9 -0
- data/closure-library/closure/goog/positioning/positioning_test_standard.html +13 -0
- data/closure-library/closure/goog/positioning/viewportclientposition.js +102 -0
- data/closure-library/closure/goog/positioning/viewportclientposition_test.html +172 -0
- data/closure-library/closure/goog/positioning/viewportposition.js +63 -0
- data/closure-library/closure/goog/proto/proto.js +43 -0
- data/closure-library/closure/goog/proto/serializer.js +68 -0
- data/closure-library/closure/goog/proto/serializer_test.html +43 -0
- data/closure-library/closure/goog/proto2/descriptor.js +198 -0
- data/closure-library/closure/goog/proto2/descriptor_test.html +60 -0
- data/closure-library/closure/goog/proto2/fielddescriptor.js +288 -0
- data/closure-library/closure/goog/proto2/fielddescriptor_test.html +124 -0
- data/closure-library/closure/goog/proto2/lazydeserializer.js +69 -0
- data/closure-library/closure/goog/proto2/message.js +726 -0
- data/closure-library/closure/goog/proto2/message_test.html +356 -0
- data/closure-library/closure/goog/proto2/objectserializer.js +159 -0
- data/closure-library/closure/goog/proto2/objectserializer_test.html +423 -0
- data/closure-library/closure/goog/proto2/package_test.pb.js +164 -0
- data/closure-library/closure/goog/proto2/pbliteserializer.js +150 -0
- data/closure-library/closure/goog/proto2/pbliteserializer_test.html +267 -0
- data/closure-library/closure/goog/proto2/proto_test.html +693 -0
- data/closure-library/closure/goog/proto2/serializer.js +148 -0
- data/closure-library/closure/goog/proto2/test.pb.js +2820 -0
- data/closure-library/closure/goog/proto2/util.js +54 -0
- data/closure-library/closure/goog/pubsub/pubsub.js +326 -0
- data/closure-library/closure/goog/pubsub/pubsub_test.html +635 -0
- data/closure-library/closure/goog/reflect/reflect.js +50 -0
- data/closure-library/closure/goog/spell/spellcheck.js +474 -0
- data/closure-library/closure/goog/spell/spellcheck_test.html +112 -0
- data/closure-library/closure/goog/string/path.js +100 -0
- data/closure-library/closure/goog/string/path_test.html +59 -0
- data/closure-library/closure/goog/string/string.js +1207 -0
- data/closure-library/closure/goog/string/string_test.html +877 -0
- data/closure-library/closure/goog/string/stringbuffer.js +167 -0
- data/closure-library/closure/goog/string/stringbuffer_test.html +101 -0
- data/closure-library/closure/goog/string/stringformat.js +247 -0
- data/closure-library/closure/goog/string/stringformat_test.html +211 -0
- data/closure-library/closure/goog/structs/avltree.js +769 -0
- data/closure-library/closure/goog/structs/avltree_test.html +241 -0
- data/closure-library/closure/goog/structs/circularbuffer.js +219 -0
- data/closure-library/closure/goog/structs/circularbuffer_test.html +105 -0
- data/closure-library/closure/goog/structs/heap.js +332 -0
- data/closure-library/closure/goog/structs/heap_test.html +220 -0
- data/closure-library/closure/goog/structs/inversionmap.js +159 -0
- data/closure-library/closure/goog/structs/inversionmap_test.html +157 -0
- data/closure-library/closure/goog/structs/linkedmap.js +472 -0
- data/closure-library/closure/goog/structs/linkedmap_test.html +300 -0
- data/closure-library/closure/goog/structs/map.js +446 -0
- data/closure-library/closure/goog/structs/map_test.html +430 -0
- data/closure-library/closure/goog/structs/node.js +74 -0
- data/closure-library/closure/goog/structs/pool.js +344 -0
- data/closure-library/closure/goog/structs/pool_test.html +265 -0
- data/closure-library/closure/goog/structs/prioritypool.js +147 -0
- data/closure-library/closure/goog/structs/prioritypool_test.html +478 -0
- data/closure-library/closure/goog/structs/priorityqueue.js +64 -0
- data/closure-library/closure/goog/structs/priorityqueue_test.html +179 -0
- data/closure-library/closure/goog/structs/quadtree.js +571 -0
- data/closure-library/closure/goog/structs/quadtree_test.html +179 -0
- data/closure-library/closure/goog/structs/queue.js +157 -0
- data/closure-library/closure/goog/structs/queue_test.html +140 -0
- data/closure-library/closure/goog/structs/set.js +251 -0
- data/closure-library/closure/goog/structs/set_test.html +551 -0
- data/closure-library/closure/goog/structs/simplepool.js +203 -0
- data/closure-library/closure/goog/structs/stringset.js +404 -0
- data/closure-library/closure/goog/structs/stringset_test.html +251 -0
- data/closure-library/closure/goog/structs/structs.js +341 -0
- data/closure-library/closure/goog/structs/structs_test.html +1050 -0
- data/closure-library/closure/goog/structs/treenode.js +312 -0
- data/closure-library/closure/goog/structs/treenode_test.html +285 -0
- data/closure-library/closure/goog/structs/trie.js +368 -0
- data/closure-library/closure/goog/structs/trie_test.html +378 -0
- data/closure-library/closure/goog/style/cursor.js +125 -0
- data/closure-library/closure/goog/style/cursor_test.html +131 -0
- data/closure-library/closure/goog/style/style.js +1804 -0
- data/closure-library/closure/goog/style/style_quirks_test.html +1928 -0
- data/closure-library/closure/goog/style/style_test.html +2073 -0
- data/closure-library/closure/goog/style/style_test_iframe_quirk.html +29 -0
- data/closure-library/closure/goog/style/style_test_iframe_standard.html +30 -0
- data/closure-library/closure/goog/style/style_test_quirk.html +9 -0
- data/closure-library/closure/goog/style/style_test_standard.html +11 -0
- data/closure-library/closure/goog/testing/asserts.js +970 -0
- data/closure-library/closure/goog/testing/asserts_test.html +966 -0
- data/closure-library/closure/goog/testing/async/mockcontrol.js +174 -0
- data/closure-library/closure/goog/testing/async/mockcontrol_test.html +224 -0
- data/closure-library/closure/goog/testing/asynctestcase.js +812 -0
- data/closure-library/closure/goog/testing/asynctestcase_async_test.html +102 -0
- data/closure-library/closure/goog/testing/asynctestcase_noasync_test.html +98 -0
- data/closure-library/closure/goog/testing/benchmark.js +87 -0
- data/closure-library/closure/goog/testing/benchmarks/jsbinarysizebutton.js +64 -0
- data/closure-library/closure/goog/testing/benchmarks/jsbinarysizebutton_test.html +58 -0
- data/closure-library/closure/goog/testing/benchmarks/jsbinarysizetoolbar.js +66 -0
- data/closure-library/closure/goog/testing/benchmarks/jsbinarysizetoolbar_test.html +49 -0
- data/closure-library/closure/goog/testing/continuationtestcase.js +682 -0
- data/closure-library/closure/goog/testing/continuationtestcase_test.html +349 -0
- data/closure-library/closure/goog/testing/deferredtestcase.js +157 -0
- data/closure-library/closure/goog/testing/deferredtestcase_test.html +152 -0
- data/closure-library/closure/goog/testing/dom.js +596 -0
- data/closure-library/closure/goog/testing/dom_test.html +438 -0
- data/closure-library/closure/goog/testing/editor/dom.js +293 -0
- data/closure-library/closure/goog/testing/editor/dom_test.html +295 -0
- data/closure-library/closure/goog/testing/editor/fieldmock.js +90 -0
- data/closure-library/closure/goog/testing/editor/testhelper.js +168 -0
- data/closure-library/closure/goog/testing/editor/testhelper_test.html +176 -0
- data/closure-library/closure/goog/testing/events/eventobserver.js +85 -0
- data/closure-library/closure/goog/testing/events/eventobserver_test.html +70 -0
- data/closure-library/closure/goog/testing/events/events.js +540 -0
- data/closure-library/closure/goog/testing/events/events_test.html +434 -0
- data/closure-library/closure/goog/testing/events/matchers.js +41 -0
- data/closure-library/closure/goog/testing/events/matchers_test.html +40 -0
- data/closure-library/closure/goog/testing/expectedfailures.js +236 -0
- data/closure-library/closure/goog/testing/expectedfailures_test.html +122 -0
- data/closure-library/closure/goog/testing/fs/blob.js +74 -0
- data/closure-library/closure/goog/testing/fs/blob_test.html +53 -0
- data/closure-library/closure/goog/testing/fs/directoryentry_test.html +185 -0
- data/closure-library/closure/goog/testing/fs/entry.js +511 -0
- data/closure-library/closure/goog/testing/fs/entry_test.html +153 -0
- data/closure-library/closure/goog/testing/fs/file.js +51 -0
- data/closure-library/closure/goog/testing/fs/fileentry_test.html +54 -0
- data/closure-library/closure/goog/testing/fs/filesystem.js +64 -0
- data/closure-library/closure/goog/testing/fs/filewriter.js +314 -0
- data/closure-library/closure/goog/testing/fs/filewriter_test.html +248 -0
- data/closure-library/closure/goog/testing/fs/fs.js +146 -0
- data/closure-library/closure/goog/testing/fs/fs_test.html +54 -0
- data/closure-library/closure/goog/testing/fs/integration_test.html +219 -0
- data/closure-library/closure/goog/testing/functionmock.js +157 -0
- data/closure-library/closure/goog/testing/functionmock_test.html +357 -0
- data/closure-library/closure/goog/testing/graphics.js +64 -0
- data/closure-library/closure/goog/testing/jsunit.js +144 -0
- data/closure-library/closure/goog/testing/loosemock.js +240 -0
- data/closure-library/closure/goog/testing/loosemock_test.html +343 -0
- data/closure-library/closure/goog/testing/messaging/mockmessagechannel.js +77 -0
- data/closure-library/closure/goog/testing/messaging/mockmessageevent.js +100 -0
- data/closure-library/closure/goog/testing/mock.js +556 -0
- data/closure-library/closure/goog/testing/mock_test.html +208 -0
- data/closure-library/closure/goog/testing/mockclassfactory.js +580 -0
- data/closure-library/closure/goog/testing/mockclassfactory_test.html +241 -0
- data/closure-library/closure/goog/testing/mockclock.js +395 -0
- data/closure-library/closure/goog/testing/mockclock_test.html +413 -0
- data/closure-library/closure/goog/testing/mockcontrol.js +210 -0
- data/closure-library/closure/goog/testing/mockcontrol_test.html +127 -0
- data/closure-library/closure/goog/testing/mockinterface.js +45 -0
- data/closure-library/closure/goog/testing/mockmatchers.js +395 -0
- data/closure-library/closure/goog/testing/mockmatchers_test.html +388 -0
- data/closure-library/closure/goog/testing/mockrandom.js +128 -0
- data/closure-library/closure/goog/testing/mockrandom_test.html +56 -0
- data/closure-library/closure/goog/testing/mockrange.js +65 -0
- data/closure-library/closure/goog/testing/mockrange_test.html +41 -0
- data/closure-library/closure/goog/testing/mockuseragent.js +143 -0
- data/closure-library/closure/goog/testing/mockuseragent_test.html +59 -0
- data/closure-library/closure/goog/testing/multitestrunner.js +1442 -0
- data/closure-library/closure/goog/testing/net/xhrio.js +595 -0
- data/closure-library/closure/goog/testing/net/xhrio_test.html +321 -0
- data/closure-library/closure/goog/testing/objectpropertystring.js +67 -0
- data/closure-library/closure/goog/testing/performancetable.css +46 -0
- data/closure-library/closure/goog/testing/performancetable.js +162 -0
- data/closure-library/closure/goog/testing/performancetimer.js +166 -0
- data/closure-library/closure/goog/testing/performancetimer_test.html +107 -0
- data/closure-library/closure/goog/testing/propertyreplacer.js +243 -0
- data/closure-library/closure/goog/testing/propertyreplacer_test.html +368 -0
- data/closure-library/closure/goog/testing/pseudorandom.js +162 -0
- data/closure-library/closure/goog/testing/pseudorandom_test.html +98 -0
- data/closure-library/closure/goog/testing/recordfunction.js +194 -0
- data/closure-library/closure/goog/testing/recordfunction_test.html +147 -0
- data/closure-library/closure/goog/testing/singleton.js +82 -0
- data/closure-library/closure/goog/testing/singleton_test.html +39 -0
- data/closure-library/closure/goog/testing/stacktrace.js +470 -0
- data/closure-library/closure/goog/testing/stacktrace_test.html +229 -0
- data/closure-library/closure/goog/testing/strictmock.js +124 -0
- data/closure-library/closure/goog/testing/strictmock_test.html +368 -0
- data/closure-library/closure/goog/testing/style/layoutasserts.js +368 -0
- data/closure-library/closure/goog/testing/style/layoutasserts_test.html +269 -0
- data/closure-library/closure/goog/testing/testcase.js +1053 -0
- data/closure-library/closure/goog/testing/testqueue.js +66 -0
- data/closure-library/closure/goog/testing/testrunner.js +391 -0
- data/closure-library/closure/goog/testing/ui/rendererasserts.js +50 -0
- data/closure-library/closure/goog/testing/ui/rendererasserts_test.html +51 -0
- data/closure-library/closure/goog/testing/ui/rendererharness.js +175 -0
- data/closure-library/closure/goog/testing/ui/style.js +137 -0
- data/closure-library/closure/goog/testing/ui/style_reference.html +27 -0
- data/closure-library/closure/goog/testing/ui/style_test.html +130 -0
- data/closure-library/closure/goog/timer/timer.js +285 -0
- data/closure-library/closure/goog/timer/timer_test.html +118 -0
- data/closure-library/closure/goog/tweak/entries.js +990 -0
- data/closure-library/closure/goog/tweak/entries_test.html +94 -0
- data/closure-library/closure/goog/tweak/registry.js +310 -0
- data/closure-library/closure/goog/tweak/registry_test.html +144 -0
- data/closure-library/closure/goog/tweak/testhelpers.js +111 -0
- data/closure-library/closure/goog/tweak/tweak.js +318 -0
- data/closure-library/closure/goog/tweak/tweakui.js +817 -0
- data/closure-library/closure/goog/tweak/tweakui_test.html +280 -0
- data/closure-library/closure/goog/ui/abstractspellchecker.js +1069 -0
- data/closure-library/closure/goog/ui/activitymonitor.js +286 -0
- data/closure-library/closure/goog/ui/activitymonitor_test.html +44 -0
- data/closure-library/closure/goog/ui/advancedtooltip.js +369 -0
- data/closure-library/closure/goog/ui/advancedtooltip_test.html +274 -0
- data/closure-library/closure/goog/ui/animatedzippy.js +190 -0
- data/closure-library/closure/goog/ui/attachablemenu.js +464 -0
- data/closure-library/closure/goog/ui/autocomplete/arraymatcher.js +156 -0
- data/closure-library/closure/goog/ui/autocomplete/arraymatcher_test.html +130 -0
- data/closure-library/closure/goog/ui/autocomplete/autocomplete.js +627 -0
- data/closure-library/closure/goog/ui/autocomplete/autocomplete_test.html +537 -0
- data/closure-library/closure/goog/ui/autocomplete/basic.js +53 -0
- data/closure-library/closure/goog/ui/autocomplete/basic_test.html +204 -0
- data/closure-library/closure/goog/ui/autocomplete/inputhandler.js +1209 -0
- data/closure-library/closure/goog/ui/autocomplete/inputhandler_test.html +555 -0
- data/closure-library/closure/goog/ui/autocomplete/remote.js +117 -0
- data/closure-library/closure/goog/ui/autocomplete/remotearraymatcher.js +273 -0
- data/closure-library/closure/goog/ui/autocomplete/remotearraymatcher_test.html +73 -0
- data/closure-library/closure/goog/ui/autocomplete/renderer.js +852 -0
- data/closure-library/closure/goog/ui/autocomplete/renderer_test.html +386 -0
- data/closure-library/closure/goog/ui/autocomplete/richinputhandler.js +59 -0
- data/closure-library/closure/goog/ui/autocomplete/richremote.js +108 -0
- data/closure-library/closure/goog/ui/autocomplete/richremotearraymatcher.js +126 -0
- data/closure-library/closure/goog/ui/basicmenu.js +930 -0
- data/closure-library/closure/goog/ui/bidiinput.js +164 -0
- data/closure-library/closure/goog/ui/bubble.js +475 -0
- data/closure-library/closure/goog/ui/button.js +208 -0
- data/closure-library/closure/goog/ui/button_test.html +257 -0
- data/closure-library/closure/goog/ui/buttonrenderer.js +205 -0
- data/closure-library/closure/goog/ui/buttonrenderer_test.html +190 -0
- data/closure-library/closure/goog/ui/buttonside.js +40 -0
- data/closure-library/closure/goog/ui/cccbutton.js +281 -0
- data/closure-library/closure/goog/ui/charcounter.js +200 -0
- data/closure-library/closure/goog/ui/charpicker.js +807 -0
- data/closure-library/closure/goog/ui/checkbox.js +303 -0
- data/closure-library/closure/goog/ui/checkbox_test.html +224 -0
- data/closure-library/closure/goog/ui/checkboxmenuitem.js +53 -0
- data/closure-library/closure/goog/ui/colorbutton.js +58 -0
- data/closure-library/closure/goog/ui/colorbutton_test.html +70 -0
- data/closure-library/closure/goog/ui/colorbuttonrenderer.js +72 -0
- data/closure-library/closure/goog/ui/colormenubutton.js +213 -0
- data/closure-library/closure/goog/ui/colormenubuttonrenderer.js +144 -0
- data/closure-library/closure/goog/ui/colormenubuttonrenderer_test.html +88 -0
- data/closure-library/closure/goog/ui/colorpalette.js +162 -0
- data/closure-library/closure/goog/ui/colorpalette_test.html +169 -0
- data/closure-library/closure/goog/ui/colorpicker.js +344 -0
- data/closure-library/closure/goog/ui/colorsplitbehavior.js +61 -0
- data/closure-library/closure/goog/ui/combobox.js +894 -0
- data/closure-library/closure/goog/ui/combobox_test.html +208 -0
- data/closure-library/closure/goog/ui/component.js +1187 -0
- data/closure-library/closure/goog/ui/component_test.html +723 -0
- data/closure-library/closure/goog/ui/container.js +1296 -0
- data/closure-library/closure/goog/ui/container_test.html +450 -0
- data/closure-library/closure/goog/ui/containerrenderer.js +370 -0
- data/closure-library/closure/goog/ui/containerrenderer_test.html +227 -0
- data/closure-library/closure/goog/ui/containerscroller.js +221 -0
- data/closure-library/closure/goog/ui/containerscroller_test.html +213 -0
- data/closure-library/closure/goog/ui/control.js +1348 -0
- data/closure-library/closure/goog/ui/control_test.html +2128 -0
- data/closure-library/closure/goog/ui/controlcontent.js +28 -0
- data/closure-library/closure/goog/ui/controlrenderer.js +808 -0
- data/closure-library/closure/goog/ui/controlrenderer_test.html +840 -0
- data/closure-library/closure/goog/ui/cookieeditor.js +182 -0
- data/closure-library/closure/goog/ui/cookieeditor_test.html +102 -0
- data/closure-library/closure/goog/ui/css3buttonrenderer.js +147 -0
- data/closure-library/closure/goog/ui/css3menubuttonrenderer.js +144 -0
- data/closure-library/closure/goog/ui/cssnames.js +28 -0
- data/closure-library/closure/goog/ui/custombutton.js +58 -0
- data/closure-library/closure/goog/ui/custombuttonrenderer.js +254 -0
- data/closure-library/closure/goog/ui/customcolorpalette.js +137 -0
- data/closure-library/closure/goog/ui/customcolorpalette_test.html +60 -0
- data/closure-library/closure/goog/ui/datepicker.js +1339 -0
- data/closure-library/closure/goog/ui/datepicker_test.html +190 -0
- data/closure-library/closure/goog/ui/decorate.js +37 -0
- data/closure-library/closure/goog/ui/decorate_test.html +113 -0
- data/closure-library/closure/goog/ui/deprecatedbutton.js +381 -0
- data/closure-library/closure/goog/ui/dialog.js +1776 -0
- data/closure-library/closure/goog/ui/dialog_test.html +493 -0
- data/closure-library/closure/goog/ui/dimensionpicker.js +289 -0
- data/closure-library/closure/goog/ui/dimensionpicker_test.html +128 -0
- data/closure-library/closure/goog/ui/dimensionpickerrenderer.js +387 -0
- data/closure-library/closure/goog/ui/dragdropdetector.js +642 -0
- data/closure-library/closure/goog/ui/drilldownrow.js +494 -0
- data/closure-library/closure/goog/ui/editor/abstractdialog.js +443 -0
- data/closure-library/closure/goog/ui/editor/abstractdialog_test.html +467 -0
- data/closure-library/closure/goog/ui/editor/bubble.js +520 -0
- data/closure-library/closure/goog/ui/editor/bubble_test.html +264 -0
- data/closure-library/closure/goog/ui/editor/defaulttoolbar.js +1062 -0
- data/closure-library/closure/goog/ui/editor/linkdialog.js +833 -0
- data/closure-library/closure/goog/ui/editor/linkdialog_test.html +449 -0
- data/closure-library/closure/goog/ui/editor/messages.js +115 -0
- data/closure-library/closure/goog/ui/editor/tabpane.js +183 -0
- data/closure-library/closure/goog/ui/editor/toolbarcontroller.js +293 -0
- data/closure-library/closure/goog/ui/editor/toolbarfactory.js +437 -0
- data/closure-library/closure/goog/ui/editor/toolbarfactory_test.html +73 -0
- data/closure-library/closure/goog/ui/emoji/emoji.js +72 -0
- data/closure-library/closure/goog/ui/emoji/emojipalette.js +298 -0
- data/closure-library/closure/goog/ui/emoji/emojipaletterenderer.js +206 -0
- data/closure-library/closure/goog/ui/emoji/emojipicker.js +797 -0
- data/closure-library/closure/goog/ui/emoji/emojipicker_test.html +840 -0
- data/closure-library/closure/goog/ui/emoji/fast_nonprogressive_emojipicker_test.html +256 -0
- data/closure-library/closure/goog/ui/emoji/fast_progressive_emojipicker_test.html +256 -0
- data/closure-library/closure/goog/ui/emoji/popupemojipicker.js +410 -0
- data/closure-library/closure/goog/ui/emoji/popupemojipicker_test.html +80 -0
- data/closure-library/closure/goog/ui/emoji/progressiveemojipaletterenderer.js +97 -0
- data/closure-library/closure/goog/ui/emoji/spriteinfo.js +212 -0
- data/closure-library/closure/goog/ui/emoji/spriteinfo_test.html +51 -0
- data/closure-library/closure/goog/ui/filteredmenu.js +562 -0
- data/closure-library/closure/goog/ui/filteredmenu_test.html +299 -0
- data/closure-library/closure/goog/ui/filterobservingmenuitem.js +97 -0
- data/closure-library/closure/goog/ui/filterobservingmenuitemrenderer.js +60 -0
- data/closure-library/closure/goog/ui/flatbuttonrenderer.js +138 -0
- data/closure-library/closure/goog/ui/flatmenubuttonrenderer.js +199 -0
- data/closure-library/closure/goog/ui/formpost.js +109 -0
- data/closure-library/closure/goog/ui/formpost_test.html +109 -0
- data/closure-library/closure/goog/ui/gauge.js +999 -0
- data/closure-library/closure/goog/ui/gaugetheme.js +169 -0
- data/closure-library/closure/goog/ui/hovercard.js +447 -0
- data/closure-library/closure/goog/ui/hovercard_test.html +343 -0
- data/closure-library/closure/goog/ui/hsvapalette.js +311 -0
- data/closure-library/closure/goog/ui/hsvapalette_test.html +152 -0
- data/closure-library/closure/goog/ui/hsvpalette.js +470 -0
- data/closure-library/closure/goog/ui/hsvpalette_test.html +202 -0
- data/closure-library/closure/goog/ui/idgenerator.js +57 -0
- data/closure-library/closure/goog/ui/idletimer.js +299 -0
- data/closure-library/closure/goog/ui/idletimer_test.html +100 -0
- data/closure-library/closure/goog/ui/iframemask.js +256 -0
- data/closure-library/closure/goog/ui/iframemask_test.html +230 -0
- data/closure-library/closure/goog/ui/imagelessbuttonrenderer.js +204 -0
- data/closure-library/closure/goog/ui/imagelessmenubuttonrenderer.js +202 -0
- data/closure-library/closure/goog/ui/imagelessroundedcorner.js +971 -0
- data/closure-library/closure/goog/ui/inputdatepicker.js +306 -0
- data/closure-library/closure/goog/ui/inputdatepicker_test.html +109 -0
- data/closure-library/closure/goog/ui/itemevent.js +50 -0
- data/closure-library/closure/goog/ui/keyboardshortcuthandler.js +981 -0
- data/closure-library/closure/goog/ui/keyboardshortcuthandler_test.html +671 -0
- data/closure-library/closure/goog/ui/labelinput.js +439 -0
- data/closure-library/closure/goog/ui/linkbuttonrenderer.js +67 -0
- data/closure-library/closure/goog/ui/media/flashobject.js +629 -0
- data/closure-library/closure/goog/ui/media/flashobject_test.html +236 -0
- data/closure-library/closure/goog/ui/media/flickr.js +309 -0
- data/closure-library/closure/goog/ui/media/flickr_test.html +90 -0
- data/closure-library/closure/goog/ui/media/media.js +284 -0
- data/closure-library/closure/goog/ui/media/media_test.html +161 -0
- data/closure-library/closure/goog/ui/media/mediamodel.js +840 -0
- data/closure-library/closure/goog/ui/media/mp3.js +225 -0
- data/closure-library/closure/goog/ui/media/mp3_test.html +78 -0
- data/closure-library/closure/goog/ui/media/photo.js +139 -0
- data/closure-library/closure/goog/ui/media/photo_test.html +62 -0
- data/closure-library/closure/goog/ui/media/picasa.js +317 -0
- data/closure-library/closure/goog/ui/media/picasa_test.html +131 -0
- data/closure-library/closure/goog/ui/media/vimeo.js +264 -0
- data/closure-library/closure/goog/ui/media/vimeo_test.html +79 -0
- data/closure-library/closure/goog/ui/media/youtube.js +328 -0
- data/closure-library/closure/goog/ui/media/youtube_test.html +185 -0
- data/closure-library/closure/goog/ui/menu.js +435 -0
- data/closure-library/closure/goog/ui/menu_test.html +129 -0
- data/closure-library/closure/goog/ui/menubase.js +191 -0
- data/closure-library/closure/goog/ui/menubutton.js +809 -0
- data/closure-library/closure/goog/ui/menubutton_test.html +440 -0
- data/closure-library/closure/goog/ui/menubutton_test_frame.html +41 -0
- data/closure-library/closure/goog/ui/menubuttonrenderer.js +226 -0
- data/closure-library/closure/goog/ui/menubuttonrenderer_test.html +161 -0
- data/closure-library/closure/goog/ui/menuheader.js +62 -0
- data/closure-library/closure/goog/ui/menuheaderrenderer.js +55 -0
- data/closure-library/closure/goog/ui/menuitem.js +154 -0
- data/closure-library/closure/goog/ui/menuitem_test.html +506 -0
- data/closure-library/closure/goog/ui/menuitemrenderer.js +353 -0
- data/closure-library/closure/goog/ui/menuitemrenderer_test.html +190 -0
- data/closure-library/closure/goog/ui/menurenderer.js +118 -0
- data/closure-library/closure/goog/ui/menuseparator.js +51 -0
- data/closure-library/closure/goog/ui/menuseparatorrenderer.js +102 -0
- data/closure-library/closure/goog/ui/mockactivitymonitor.js +54 -0
- data/closure-library/closure/goog/ui/nativebuttonrenderer.js +205 -0
- data/closure-library/closure/goog/ui/nativebuttonrenderer_test.html +213 -0
- data/closure-library/closure/goog/ui/offlineinstalldialog.js +1086 -0
- data/closure-library/closure/goog/ui/offlinestatuscard.js +580 -0
- data/closure-library/closure/goog/ui/offlinestatuscomponent.js +545 -0
- data/closure-library/closure/goog/ui/option.js +67 -0
- data/closure-library/closure/goog/ui/palette.js +528 -0
- data/closure-library/closure/goog/ui/paletterenderer.js +318 -0
- data/closure-library/closure/goog/ui/plaintextspellchecker.js +668 -0
- data/closure-library/closure/goog/ui/plaintextspellchecker_test.html +240 -0
- data/closure-library/closure/goog/ui/popup.js +410 -0
- data/closure-library/closure/goog/ui/popup_test.html +137 -0
- data/closure-library/closure/goog/ui/popupbase.js +721 -0
- data/closure-library/closure/goog/ui/popupbase_test.html +186 -0
- data/closure-library/closure/goog/ui/popupcolorpicker.js +441 -0
- data/closure-library/closure/goog/ui/popupcolorpicker_test.html +71 -0
- data/closure-library/closure/goog/ui/popupdatepicker.js +273 -0
- data/closure-library/closure/goog/ui/popupmenu.js +539 -0
- data/closure-library/closure/goog/ui/popupmenu_test.html +197 -0
- data/closure-library/closure/goog/ui/progressbar.js +390 -0
- data/closure-library/closure/goog/ui/prompt.js +307 -0
- data/closure-library/closure/goog/ui/prompt_test.html +65 -0
- data/closure-library/closure/goog/ui/rangemodel.js +301 -0
- data/closure-library/closure/goog/ui/rangemodel_test.html +270 -0
- data/closure-library/closure/goog/ui/ratings.js +441 -0
- data/closure-library/closure/goog/ui/registry.js +166 -0
- data/closure-library/closure/goog/ui/registry_test.html +236 -0
- data/closure-library/closure/goog/ui/richtextspellchecker.js +600 -0
- data/closure-library/closure/goog/ui/richtextspellchecker_test.html +224 -0
- data/closure-library/closure/goog/ui/roundedcorners.js +694 -0
- data/closure-library/closure/goog/ui/roundedpanel.js +609 -0
- data/closure-library/closure/goog/ui/roundedpanel_test.html +57 -0
- data/closure-library/closure/goog/ui/roundedtabrenderer.js +196 -0
- data/closure-library/closure/goog/ui/scrollfloater.js +394 -0
- data/closure-library/closure/goog/ui/scrollfloater_test.html +46 -0
- data/closure-library/closure/goog/ui/select.js +397 -0
- data/closure-library/closure/goog/ui/select_test.html +152 -0
- data/closure-library/closure/goog/ui/selectionmenubutton.js +277 -0
- data/closure-library/closure/goog/ui/selectionmenubutton_test.html +237 -0
- data/closure-library/closure/goog/ui/selectionmodel.js +291 -0
- data/closure-library/closure/goog/ui/separator.js +74 -0
- data/closure-library/closure/goog/ui/serverchart.js +1791 -0
- data/closure-library/closure/goog/ui/serverchart_test.html +598 -0
- data/closure-library/closure/goog/ui/slider.js +125 -0
- data/closure-library/closure/goog/ui/sliderbase.js +1087 -0
- data/closure-library/closure/goog/ui/sliderbase_test.html +198 -0
- data/closure-library/closure/goog/ui/splitbehavior.js +348 -0
- data/closure-library/closure/goog/ui/splitbehavior_test.html +161 -0
- data/closure-library/closure/goog/ui/splitpane.js +844 -0
- data/closure-library/closure/goog/ui/splitpane_test.html +143 -0
- data/closure-library/closure/goog/ui/style/app/buttonrenderer.js +204 -0
- data/closure-library/closure/goog/ui/style/app/buttonrenderer_test.html +155 -0
- data/closure-library/closure/goog/ui/style/app/menubuttonrenderer.js +227 -0
- data/closure-library/closure/goog/ui/style/app/menubuttonrenderer_test.html +167 -0
- data/closure-library/closure/goog/ui/style/app/primaryactionbuttonrenderer.js +88 -0
- data/closure-library/closure/goog/ui/style/app/primaryactionbuttonrenderer_test.html +76 -0
- data/closure-library/closure/goog/ui/submenu.js +660 -0
- data/closure-library/closure/goog/ui/submenu_test.html +446 -0
- data/closure-library/closure/goog/ui/submenurenderer.js +188 -0
- data/closure-library/closure/goog/ui/tab.js +102 -0
- data/closure-library/closure/goog/ui/tab_test.html +61 -0
- data/closure-library/closure/goog/ui/tabbar.js +393 -0
- data/closure-library/closure/goog/ui/tabbar_test.html +611 -0
- data/closure-library/closure/goog/ui/tabbarrenderer.js +173 -0
- data/closure-library/closure/goog/ui/tabbarrenderer_test.html +137 -0
- data/closure-library/closure/goog/ui/tablesorter.js +304 -0
- data/closure-library/closure/goog/ui/tablesorter_test.html +127 -0
- data/closure-library/closure/goog/ui/tabpane.js +674 -0
- data/closure-library/closure/goog/ui/tabpane_test.html +107 -0
- data/closure-library/closure/goog/ui/tabrenderer.js +152 -0
- data/closure-library/closure/goog/ui/tabrenderer_test.html +132 -0
- data/closure-library/closure/goog/ui/textarea.js +573 -0
- data/closure-library/closure/goog/ui/textarea_test.html +305 -0
- data/closure-library/closure/goog/ui/textarearenderer.js +167 -0
- data/closure-library/closure/goog/ui/togglebutton.js +58 -0
- data/closure-library/closure/goog/ui/toolbar.js +45 -0
- data/closure-library/closure/goog/ui/toolbarbutton.js +54 -0
- data/closure-library/closure/goog/ui/toolbarbuttonrenderer.js +55 -0
- data/closure-library/closure/goog/ui/toolbarcolormenubutton.js +57 -0
- data/closure-library/closure/goog/ui/toolbarcolormenubuttonrenderer.js +95 -0
- data/closure-library/closure/goog/ui/toolbarcolormenubuttonrenderer_test.html +66 -0
- data/closure-library/closure/goog/ui/toolbarmenubutton.js +56 -0
- data/closure-library/closure/goog/ui/toolbarmenubuttonrenderer.js +55 -0
- data/closure-library/closure/goog/ui/toolbarrenderer.js +95 -0
- data/closure-library/closure/goog/ui/toolbarselect.js +55 -0
- data/closure-library/closure/goog/ui/toolbarseparator.js +51 -0
- data/closure-library/closure/goog/ui/toolbarseparatorrenderer.js +87 -0
- data/closure-library/closure/goog/ui/toolbartogglebutton.js +53 -0
- data/closure-library/closure/goog/ui/tooltip.js +975 -0
- data/closure-library/closure/goog/ui/tooltip_test.html +351 -0
- data/closure-library/closure/goog/ui/tree/basenode.js +1457 -0
- data/closure-library/closure/goog/ui/tree/basenode_test.html +218 -0
- data/closure-library/closure/goog/ui/tree/treecontrol.js +656 -0
- data/closure-library/closure/goog/ui/tree/treecontrol_test.html +113 -0
- data/closure-library/closure/goog/ui/tree/treenode.js +102 -0
- data/closure-library/closure/goog/ui/tree/typeahead.js +332 -0
- data/closure-library/closure/goog/ui/tree/typeahead_test.html +133 -0
- data/closure-library/closure/goog/ui/tristatemenuitem.js +185 -0
- data/closure-library/closure/goog/ui/tristatemenuitemrenderer.js +86 -0
- data/closure-library/closure/goog/ui/twothumbslider.js +134 -0
- data/closure-library/closure/goog/ui/zippy.js +277 -0
- data/closure-library/closure/goog/ui/zippy_test.html +223 -0
- data/closure-library/closure/goog/uri/uri.js +1595 -0
- data/closure-library/closure/goog/uri/uri_test.html +837 -0
- data/closure-library/closure/goog/uri/utils.js +972 -0
- data/closure-library/closure/goog/uri/utils_test.html +521 -0
- data/closure-library/closure/goog/useragent/adobereader.js +90 -0
- data/closure-library/closure/goog/useragent/adobereader_test.html +34 -0
- data/closure-library/closure/goog/useragent/flash.js +113 -0
- data/closure-library/closure/goog/useragent/flash_test.html +34 -0
- data/closure-library/closure/goog/useragent/iphoto.js +86 -0
- data/closure-library/closure/goog/useragent/jscript.js +94 -0
- data/closure-library/closure/goog/useragent/jscript_test.html +65 -0
- data/closure-library/closure/goog/useragent/picasa.js +111 -0
- data/closure-library/closure/goog/useragent/platform.js +70 -0
- data/closure-library/closure/goog/useragent/platform_test.html +108 -0
- data/closure-library/closure/goog/useragent/product.js +253 -0
- data/closure-library/closure/goog/useragent/product_isversion.js +99 -0
- data/closure-library/closure/goog/useragent/product_test.html +322 -0
- data/closure-library/closure/goog/useragent/useragent.js +464 -0
- data/closure-library/closure/goog/useragent/useragent_test.html +290 -0
- data/closure-library/closure/goog/window/window.js +206 -0
- data/closure-library/closure/goog/window/window_test.html +185 -0
- data/closure-library/third_party/closure/goog/base.js +2 -0
- data/closure-library/third_party/closure/goog/caja/string/html/htmlparser.js +611 -0
- data/closure-library/third_party/closure/goog/caja/string/html/htmlsanitizer.js +605 -0
- data/closure-library/third_party/closure/goog/deps.js +26 -0
- data/closure-library/third_party/closure/goog/dojo/dom/query.js +1532 -0
- data/closure-library/third_party/closure/goog/dojo/dom/query_test.html +63 -0
- data/closure-library/third_party/closure/goog/dojo/dom/query_test.js +160 -0
- data/closure-library/third_party/closure/goog/jpeg_encoder/jpeg_encoder_basic.js +751 -0
- data/closure-library/third_party/closure/goog/loremipsum/text/loremipsum.js +712 -0
- data/closure-library/third_party/closure/goog/loremipsum/text/loremipsum_test.html +61 -0
- data/closure-library/third_party/closure/goog/mochikit/async/deferred.js +530 -0
- data/closure-library/third_party/closure/goog/mochikit/async/deferred_test.html +627 -0
- data/closure-library/third_party/closure/goog/mochikit/async/deferredlist.js +199 -0
- data/closure-library/third_party/closure/goog/mochikit/async/deferredlist_test.html +426 -0
- data/closure-library/third_party/closure/goog/osapi/osapi.js +91 -0
- data/closure-library/third_party/closure/goog/silverlight/AppManifest.xml +6 -0
- data/closure-library/third_party/closure/goog/silverlight/AssemblyInfo.cs +35 -0
- data/closure-library/third_party/closure/goog/silverlight/ClipboardButton.xaml +9 -0
- data/closure-library/third_party/closure/goog/silverlight/ClipboardButton.xaml.cs +74 -0
- data/closure-library/third_party/closure/goog/silverlight/ClipboardButtonApp.xaml +8 -0
- data/closure-library/third_party/closure/goog/silverlight/ClipboardButtonApp.xaml.cs +75 -0
- data/closure-library/third_party/closure/goog/silverlight/ClosureClipboardButton.csproj +108 -0
- data/closure-library/third_party/closure/goog/silverlight/ClosureClipboardButton.csproj.user +29 -0
- data/closure-library/third_party/closure/goog/silverlight/clipboardbutton.js +279 -0
- data/closure-library/third_party/closure/goog/silverlight/silverlight.js +758 -0
- data/closure-library/third_party/closure/goog/silverlight/supporteduseragent.js +138 -0
- data/closure-library/third_party/closure/goog/silverlight/xap_files +0 -0
- data/closure-templates/COPYING +202 -0
- data/closure-templates/README +47 -0
- data/closure-templates/SoyToJsSrcCompiler.jar +0 -0
- data/closure-templates/soyutils.js +880 -0
- data/closure-templates/soyutils_usegoog.js +308 -0
- data/closure.gemspec +20 -0
- data/config.ru +40 -0
- data/java_src/ClosureScript.java +89 -0
- data/java_src/make.rb +19 -0
- data/lib/closure/beanshell.rb +80 -0
- data/lib/closure/compiler.rb +184 -0
- data/lib/closure/file_response.rb +90 -0
- data/lib/closure/goog.rb +143 -0
- data/lib/closure/middleware.rb +43 -0
- data/lib/closure/sass.rb +56 -0
- data/lib/closure/script.rb +139 -0
- data/lib/closure/server.rb +83 -0
- data/lib/closure/sources.rb +310 -0
- data/lib/closure/templates.rb +156 -0
- data/lib/closure/version.rb +20 -0
- data/lib/closure.jar +0 -0
- data/lib/closure.rb +134 -0
- data/scripts/demos/compile.js.erb +8 -0
- data/scripts/demos/compile.out +1 -0
- data/scripts/demos/compiler.haml +17 -0
- data/scripts/demos/compiler.js +12 -0
- data/scripts/demos/deps.js.erb +1 -0
- data/scripts/demos/externs.haml +16 -0
- data/scripts/demos/externs.js.erb +8 -0
- data/scripts/demos/externs.out +1 -0
- data/scripts/demos/externs_jquery.externs +849 -0
- data/scripts/demos/externs_jquery.js +167 -0
- data/scripts/demos/externs_jquerytest.js +11 -0
- data/scripts/demos/helloworld.haml +15 -0
- data/scripts/demos/helloworld.js +58 -0
- data/scripts/demos/helloworld.soy +45 -0
- data/scripts/demos/index.haml +21 -0
- data/scripts/demos/rails_ujs.haml +24 -0
- data/scripts/examples/rails/ujs.js +136 -0
- data/scripts/favicon.ico +0 -0
- data/scripts/fixtures/_partial.haml +2 -0
- data/scripts/fixtures/erb.html.erb +8 -0
- data/scripts/fixtures/haml.haml +6 -0
- data/scripts/fixtures/html.html +9 -0
- data/scripts/fixtures/route_js.js.erb +1 -0
- data/scripts/index.haml +14 -0
- data/test/beanshell_test.rb +22 -0
- data/test/server_test.rb +67 -0
- data/test/sources_test.rb +41 -0
- data/test/test_helper.rb +12 -0
- metadata +1577 -0
|
@@ -0,0 +1,1740 @@
|
|
|
1
|
+
// Copyright 2006 The Closure Library Authors. All Rights Reserved.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS-IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @fileoverview Functions to style text.
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
goog.provide('goog.editor.plugins.BasicTextFormatter');
|
|
21
|
+
goog.provide('goog.editor.plugins.BasicTextFormatter.COMMAND');
|
|
22
|
+
|
|
23
|
+
goog.require('goog.array');
|
|
24
|
+
goog.require('goog.debug.Logger');
|
|
25
|
+
goog.require('goog.dom');
|
|
26
|
+
goog.require('goog.dom.NodeType');
|
|
27
|
+
goog.require('goog.dom.TagName');
|
|
28
|
+
goog.require('goog.editor.BrowserFeature');
|
|
29
|
+
goog.require('goog.editor.Link');
|
|
30
|
+
goog.require('goog.editor.Plugin');
|
|
31
|
+
goog.require('goog.editor.node');
|
|
32
|
+
goog.require('goog.editor.range');
|
|
33
|
+
goog.require('goog.iter');
|
|
34
|
+
goog.require('goog.object');
|
|
35
|
+
goog.require('goog.string');
|
|
36
|
+
goog.require('goog.string.Unicode');
|
|
37
|
+
goog.require('goog.style');
|
|
38
|
+
goog.require('goog.ui.editor.messages');
|
|
39
|
+
goog.require('goog.userAgent');
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Functions to style text (e.g. underline, make bold, etc.)
|
|
45
|
+
* @constructor
|
|
46
|
+
* @extends {goog.editor.Plugin}
|
|
47
|
+
*/
|
|
48
|
+
goog.editor.plugins.BasicTextFormatter = function() {
|
|
49
|
+
goog.editor.Plugin.call(this);
|
|
50
|
+
};
|
|
51
|
+
goog.inherits(goog.editor.plugins.BasicTextFormatter, goog.editor.Plugin);
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
/** @inheritDoc */
|
|
55
|
+
goog.editor.plugins.BasicTextFormatter.prototype.getTrogClassId = function() {
|
|
56
|
+
return 'BTF';
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Logging object.
|
|
62
|
+
* @type {goog.debug.Logger}
|
|
63
|
+
* @protected
|
|
64
|
+
* @override
|
|
65
|
+
*/
|
|
66
|
+
goog.editor.plugins.BasicTextFormatter.prototype.logger =
|
|
67
|
+
goog.debug.Logger.getLogger('goog.editor.plugins.BasicTextFormatter');
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Commands implemented by this plugin.
|
|
72
|
+
* @enum {string}
|
|
73
|
+
*/
|
|
74
|
+
goog.editor.plugins.BasicTextFormatter.COMMAND = {
|
|
75
|
+
LINK: '+link',
|
|
76
|
+
FORMAT_BLOCK: '+formatBlock',
|
|
77
|
+
INDENT: '+indent',
|
|
78
|
+
OUTDENT: '+outdent',
|
|
79
|
+
STRIKE_THROUGH: '+strikeThrough',
|
|
80
|
+
HORIZONTAL_RULE: '+insertHorizontalRule',
|
|
81
|
+
SUBSCRIPT: '+subscript',
|
|
82
|
+
SUPERSCRIPT: '+superscript',
|
|
83
|
+
UNDERLINE: '+underline',
|
|
84
|
+
BOLD: '+bold',
|
|
85
|
+
ITALIC: '+italic',
|
|
86
|
+
FONT_SIZE: '+fontSize',
|
|
87
|
+
FONT_FACE: '+fontName',
|
|
88
|
+
FONT_COLOR: '+foreColor',
|
|
89
|
+
BACKGROUND_COLOR: '+backColor',
|
|
90
|
+
ORDERED_LIST: '+insertOrderedList',
|
|
91
|
+
UNORDERED_LIST: '+insertUnorderedList',
|
|
92
|
+
JUSTIFY_CENTER: '+justifyCenter',
|
|
93
|
+
JUSTIFY_FULL: '+justifyFull',
|
|
94
|
+
JUSTIFY_RIGHT: '+justifyRight',
|
|
95
|
+
JUSTIFY_LEFT: '+justifyLeft'
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Inverse map of execCommand strings to
|
|
101
|
+
* {@link goog.editor.plugins.BasicTextFormatter.COMMAND} constants. Used to
|
|
102
|
+
* determine whether a string corresponds to a command this plugin
|
|
103
|
+
* handles in O(1) time.
|
|
104
|
+
* @type {Object}
|
|
105
|
+
* @private
|
|
106
|
+
*/
|
|
107
|
+
goog.editor.plugins.BasicTextFormatter.SUPPORTED_COMMANDS_ =
|
|
108
|
+
goog.object.transpose(goog.editor.plugins.BasicTextFormatter.COMMAND);
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Whether the string corresponds to a command this plugin handles.
|
|
113
|
+
* @param {string} command Command string to check.
|
|
114
|
+
* @return {boolean} Whether the string corresponds to a command
|
|
115
|
+
* this plugin handles.
|
|
116
|
+
*/
|
|
117
|
+
goog.editor.plugins.BasicTextFormatter.prototype.isSupportedCommand = function(
|
|
118
|
+
command) {
|
|
119
|
+
// TODO(user): restore this to simple check once table editing
|
|
120
|
+
// is moved out into its own plugin
|
|
121
|
+
return command in goog.editor.plugins.BasicTextFormatter.SUPPORTED_COMMANDS_;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @return {goog.dom.AbstractRange} The closure range object that wraps the
|
|
127
|
+
* current user selection.
|
|
128
|
+
* @private
|
|
129
|
+
*/
|
|
130
|
+
goog.editor.plugins.BasicTextFormatter.prototype.getRange_ = function() {
|
|
131
|
+
return this.fieldObject.getRange();
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* @return {Document} The document object associated with the currently active
|
|
137
|
+
* field.
|
|
138
|
+
* @private
|
|
139
|
+
*/
|
|
140
|
+
goog.editor.plugins.BasicTextFormatter.prototype.getDocument_ = function() {
|
|
141
|
+
return this.getFieldDomHelper().getDocument();
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Execute a user-initiated command.
|
|
147
|
+
* @param {goog.editor.plugins.BasicTextFormatter.COMMAND} command Command
|
|
148
|
+
* to execute.
|
|
149
|
+
* @param {...string|number|boolean|null} var_args For color commands, this
|
|
150
|
+
* should be the hex color (with the #). For FORMAT_BLOCK, this should be
|
|
151
|
+
* the goog.editor.plugins.BasicTextFormatter.BLOCK_COMMAND.
|
|
152
|
+
* It will be unused for other commands.
|
|
153
|
+
* @return {Object|undefined} The result of the command.
|
|
154
|
+
*/
|
|
155
|
+
goog.editor.plugins.BasicTextFormatter.prototype.execCommandInternal = function(
|
|
156
|
+
command, var_args) {
|
|
157
|
+
var preserveDir, styleWithCss, needsFormatBlockDiv, hasDummySelection;
|
|
158
|
+
var result;
|
|
159
|
+
var opt_arg = arguments[1];
|
|
160
|
+
|
|
161
|
+
switch (command) {
|
|
162
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.BACKGROUND_COLOR:
|
|
163
|
+
// Don't bother for no color selected, color picker is resetting itself.
|
|
164
|
+
if (!goog.isNull(opt_arg)) {
|
|
165
|
+
if (goog.editor.BrowserFeature.EATS_EMPTY_BACKGROUND_COLOR) {
|
|
166
|
+
this.applyBgColorManually_(opt_arg);
|
|
167
|
+
} else if (goog.userAgent.OPERA) {
|
|
168
|
+
// backColor will color the block level element instead of
|
|
169
|
+
// the selected span of text in Opera.
|
|
170
|
+
this.execCommandHelper_('hiliteColor', opt_arg);
|
|
171
|
+
} else {
|
|
172
|
+
this.execCommandHelper_(command, opt_arg);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
break;
|
|
176
|
+
|
|
177
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.LINK:
|
|
178
|
+
result = this.toggleLink_(opt_arg);
|
|
179
|
+
break;
|
|
180
|
+
|
|
181
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.JUSTIFY_CENTER:
|
|
182
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.JUSTIFY_FULL:
|
|
183
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.JUSTIFY_RIGHT:
|
|
184
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.JUSTIFY_LEFT:
|
|
185
|
+
this.justify_(command);
|
|
186
|
+
break;
|
|
187
|
+
|
|
188
|
+
default:
|
|
189
|
+
if (goog.userAgent.IE &&
|
|
190
|
+
command ==
|
|
191
|
+
goog.editor.plugins.BasicTextFormatter.COMMAND.FORMAT_BLOCK &&
|
|
192
|
+
opt_arg) {
|
|
193
|
+
// IE requires that the argument be in the form of an opening
|
|
194
|
+
// tag, like <h1>, including angle brackets. WebKit will accept
|
|
195
|
+
// the arguemnt with or without brackets, and Firefox pre-3 supports
|
|
196
|
+
// only a fixed subset of tags with brackets, and prefers without.
|
|
197
|
+
// So we only add them IE only.
|
|
198
|
+
opt_arg = '<' + opt_arg + '>';
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
if (command ==
|
|
202
|
+
goog.editor.plugins.BasicTextFormatter.COMMAND.FONT_COLOR &&
|
|
203
|
+
goog.isNull(opt_arg)) {
|
|
204
|
+
// If we don't have a color, then FONT_COLOR is a no-op.
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
switch (command) {
|
|
209
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.INDENT:
|
|
210
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.OUTDENT:
|
|
211
|
+
if (goog.editor.BrowserFeature.HAS_STYLE_WITH_CSS) {
|
|
212
|
+
if (goog.userAgent.GECKO) {
|
|
213
|
+
styleWithCss = true;
|
|
214
|
+
}
|
|
215
|
+
if (goog.userAgent.OPERA) {
|
|
216
|
+
if (command ==
|
|
217
|
+
goog.editor.plugins.BasicTextFormatter.COMMAND.OUTDENT) {
|
|
218
|
+
// styleWithCSS actually sets negative margins on <blockquote>
|
|
219
|
+
// to outdent them. If the command is enabled without
|
|
220
|
+
// styleWithCSS flipped on, then the caret is in a blockquote so
|
|
221
|
+
// styleWithCSS must not be used. But if the command is not
|
|
222
|
+
// enabled, styleWithCSS should be used so that elements such as
|
|
223
|
+
// a <div> with a margin-left style can still be outdented.
|
|
224
|
+
// (Opera bug: CORE-21118)
|
|
225
|
+
styleWithCss =
|
|
226
|
+
!this.getDocument_().queryCommandEnabled('outdent');
|
|
227
|
+
} else {
|
|
228
|
+
// Always use styleWithCSS for indenting. Otherwise, Opera will
|
|
229
|
+
// make separate <blockquote>s around *each* indented line,
|
|
230
|
+
// which adds big default <blockquote> margins between each
|
|
231
|
+
// indented line.
|
|
232
|
+
styleWithCss = true;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
// Fall through.
|
|
237
|
+
|
|
238
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.ORDERED_LIST:
|
|
239
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.UNORDERED_LIST:
|
|
240
|
+
if (goog.editor.BrowserFeature.LEAVES_P_WHEN_REMOVING_LISTS &&
|
|
241
|
+
this.queryCommandStateInternal_(this.getDocument_(),
|
|
242
|
+
command)) {
|
|
243
|
+
// IE leaves behind P tags when unapplying lists.
|
|
244
|
+
// If we're not in P-mode, then we want divs
|
|
245
|
+
// So, unlistify, then convert the Ps into divs.
|
|
246
|
+
needsFormatBlockDiv = this.fieldObject.queryCommandValue(
|
|
247
|
+
goog.editor.Command.DEFAULT_TAG) != goog.dom.TagName.P;
|
|
248
|
+
} else if (!goog.editor.BrowserFeature.CAN_LISTIFY_BR) {
|
|
249
|
+
// IE doesn't convert BRed line breaks into separate list items.
|
|
250
|
+
// So convert the BRs to divs, then do the listify.
|
|
251
|
+
this.convertBreaksToDivs_();
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// This fix only works in Gecko.
|
|
255
|
+
if (goog.userAgent.GECKO &&
|
|
256
|
+
goog.editor.BrowserFeature.FORGETS_FORMATTING_WHEN_LISTIFYING &&
|
|
257
|
+
!this.queryCommandValue(command)) {
|
|
258
|
+
hasDummySelection |= this.beforeInsertListGecko_();
|
|
259
|
+
}
|
|
260
|
+
// Fall through to preserveDir block
|
|
261
|
+
|
|
262
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.FORMAT_BLOCK:
|
|
263
|
+
// Both FF & IE may lose directionality info. Save/restore it.
|
|
264
|
+
// TODO(user): Does Safari also need this?
|
|
265
|
+
// TODO (gmark, jparent): This isn't ideal because it uses a string
|
|
266
|
+
// literal, so if the plugin name changes, it would break. We need a
|
|
267
|
+
// better solution. See also other places in code that use
|
|
268
|
+
// this.getPluginByClassId('Bidi').
|
|
269
|
+
preserveDir = !!this.fieldObject.getPluginByClassId('Bidi');
|
|
270
|
+
break;
|
|
271
|
+
|
|
272
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.SUBSCRIPT:
|
|
273
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.SUPERSCRIPT:
|
|
274
|
+
if (goog.editor.BrowserFeature.NESTS_SUBSCRIPT_SUPERSCRIPT) {
|
|
275
|
+
// This browser nests subscript and superscript when both are
|
|
276
|
+
// applied, instead of canceling out the first when applying the
|
|
277
|
+
// second.
|
|
278
|
+
this.applySubscriptSuperscriptWorkarounds_(command);
|
|
279
|
+
}
|
|
280
|
+
break;
|
|
281
|
+
|
|
282
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.UNDERLINE:
|
|
283
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.BOLD:
|
|
284
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.ITALIC:
|
|
285
|
+
// If we are applying the formatting, then we want to have
|
|
286
|
+
// styleWithCSS false so that we generate html tags (like <b>). If we
|
|
287
|
+
// are unformatting something, we want to have styleWithCSS true so
|
|
288
|
+
// that we can unformat both html tags and inline styling.
|
|
289
|
+
// TODO(user): What about WebKit and Opera?
|
|
290
|
+
styleWithCss = goog.userAgent.GECKO &&
|
|
291
|
+
goog.editor.BrowserFeature.HAS_STYLE_WITH_CSS &&
|
|
292
|
+
this.queryCommandValue(command);
|
|
293
|
+
break;
|
|
294
|
+
|
|
295
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.FONT_COLOR:
|
|
296
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.FONT_FACE:
|
|
297
|
+
// It is very expensive in FF (order of magnitude difference) to use
|
|
298
|
+
// font tags instead of styled spans. Whenever possible,
|
|
299
|
+
// force FF to use spans.
|
|
300
|
+
// Font size is very expensive too, but FF always uses font tags,
|
|
301
|
+
// regardless of which styleWithCSS value you use.
|
|
302
|
+
styleWithCss = goog.editor.BrowserFeature.HAS_STYLE_WITH_CSS &&
|
|
303
|
+
goog.userAgent.GECKO;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Cases where we just use the default execCommand (in addition
|
|
308
|
+
* to the above fall-throughs)
|
|
309
|
+
* goog.editor.plugins.BasicTextFormatter.COMMAND.STRIKE_THROUGH:
|
|
310
|
+
* goog.editor.plugins.BasicTextFormatter.COMMAND.HORIZONTAL_RULE:
|
|
311
|
+
* goog.editor.plugins.BasicTextFormatter.COMMAND.SUBSCRIPT:
|
|
312
|
+
* goog.editor.plugins.BasicTextFormatter.COMMAND.SUPERSCRIPT:
|
|
313
|
+
* goog.editor.plugins.BasicTextFormatter.COMMAND.UNDERLINE:
|
|
314
|
+
* goog.editor.plugins.BasicTextFormatter.COMMAND.BOLD:
|
|
315
|
+
* goog.editor.plugins.BasicTextFormatter.COMMAND.ITALIC:
|
|
316
|
+
* goog.editor.plugins.BasicTextFormatter.COMMAND.FONT_SIZE:
|
|
317
|
+
* goog.editor.plugins.BasicTextFormatter.COMMAND.FONT_FACE:
|
|
318
|
+
*/
|
|
319
|
+
this.execCommandHelper_(command, opt_arg, preserveDir, styleWithCss);
|
|
320
|
+
|
|
321
|
+
if (hasDummySelection) {
|
|
322
|
+
this.getDocument_().execCommand('Delete', false, true);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
if (needsFormatBlockDiv) {
|
|
326
|
+
this.getDocument_().execCommand('FormatBlock', false, '<div>');
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
// FF loses focus, so we have to set the focus back to the document or the
|
|
330
|
+
// user can't type after selecting from menu. In IE, focus is set correctly
|
|
331
|
+
// and resetting it here messes it up.
|
|
332
|
+
if (goog.userAgent.GECKO && !this.fieldObject.inModalMode()) {
|
|
333
|
+
this.focusField_();
|
|
334
|
+
}
|
|
335
|
+
return result;
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Focuses on the field.
|
|
341
|
+
* @private
|
|
342
|
+
*/
|
|
343
|
+
goog.editor.plugins.BasicTextFormatter.prototype.focusField_ = function() {
|
|
344
|
+
this.getFieldDomHelper().getWindow().focus();
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Gets the command value.
|
|
350
|
+
* @param {string} command The command value to get.
|
|
351
|
+
* @return {string|boolean|null} The current value of the command in the given
|
|
352
|
+
* selection. NOTE: This return type list is not documented in MSDN or MDC
|
|
353
|
+
* and has been constructed from experience. Please update it
|
|
354
|
+
* if necessary.
|
|
355
|
+
*/
|
|
356
|
+
goog.editor.plugins.BasicTextFormatter.prototype.queryCommandValue = function(
|
|
357
|
+
command) {
|
|
358
|
+
var styleWithCss;
|
|
359
|
+
switch (command) {
|
|
360
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.LINK:
|
|
361
|
+
return this.isNodeInState_(goog.dom.TagName.A);
|
|
362
|
+
|
|
363
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.JUSTIFY_CENTER:
|
|
364
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.JUSTIFY_FULL:
|
|
365
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.JUSTIFY_RIGHT:
|
|
366
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.JUSTIFY_LEFT:
|
|
367
|
+
return this.isJustification_(command);
|
|
368
|
+
|
|
369
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.FORMAT_BLOCK:
|
|
370
|
+
// TODO(nicksantos): See if we can use queryCommandValue here.
|
|
371
|
+
return goog.editor.plugins.BasicTextFormatter.getSelectionBlockState_(
|
|
372
|
+
this.fieldObject.getRange());
|
|
373
|
+
|
|
374
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.INDENT:
|
|
375
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.OUTDENT:
|
|
376
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.HORIZONTAL_RULE:
|
|
377
|
+
// TODO: See if there are reasonable results to return for
|
|
378
|
+
// these commands.
|
|
379
|
+
return false;
|
|
380
|
+
|
|
381
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.FONT_SIZE:
|
|
382
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.FONT_FACE:
|
|
383
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.FONT_COLOR:
|
|
384
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.BACKGROUND_COLOR:
|
|
385
|
+
// We use queryCommandValue here since we don't just want to know if a
|
|
386
|
+
// color/fontface/fontsize is applied, we want to know WHICH one it is.
|
|
387
|
+
return this.queryCommandValueInternal_(this.getDocument_(), command,
|
|
388
|
+
goog.editor.BrowserFeature.HAS_STYLE_WITH_CSS &&
|
|
389
|
+
goog.userAgent.GECKO);
|
|
390
|
+
|
|
391
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.UNDERLINE:
|
|
392
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.BOLD:
|
|
393
|
+
case goog.editor.plugins.BasicTextFormatter.COMMAND.ITALIC:
|
|
394
|
+
styleWithCss = goog.editor.BrowserFeature.HAS_STYLE_WITH_CSS &&
|
|
395
|
+
goog.userAgent.GECKO;
|
|
396
|
+
|
|
397
|
+
default:
|
|
398
|
+
/**
|
|
399
|
+
* goog.editor.plugins.BasicTextFormatter.COMMAND.STRIKE_THROUGH
|
|
400
|
+
* goog.editor.plugins.BasicTextFormatter.COMMAND.SUBSCRIPT
|
|
401
|
+
* goog.editor.plugins.BasicTextFormatter.COMMAND.SUPERSCRIPT
|
|
402
|
+
* goog.editor.plugins.BasicTextFormatter.COMMAND.UNDERLINE
|
|
403
|
+
* goog.editor.plugins.BasicTextFormatter.COMMAND.BOLD
|
|
404
|
+
* goog.editor.plugins.BasicTextFormatter.COMMAND.ITALIC
|
|
405
|
+
* goog.editor.plugins.BasicTextFormatter.COMMAND.ORDERED_LIST
|
|
406
|
+
* goog.editor.plugins.BasicTextFormatter.COMMAND.UNORDERED_LIST
|
|
407
|
+
*/
|
|
408
|
+
// This only works for commands that use the default execCommand
|
|
409
|
+
return this.queryCommandStateInternal_(this.getDocument_(), command,
|
|
410
|
+
styleWithCss);
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* @inheritDoc
|
|
417
|
+
*/
|
|
418
|
+
goog.editor.plugins.BasicTextFormatter.prototype.prepareContentsHtml =
|
|
419
|
+
function(html) {
|
|
420
|
+
// If the browser collapses empty nodes and the field has only a script
|
|
421
|
+
// tag in it, then it will collapse this node. Which will mean the user
|
|
422
|
+
// can't click into it to edit it.
|
|
423
|
+
if (goog.editor.BrowserFeature.COLLAPSES_EMPTY_NODES &&
|
|
424
|
+
html.match(/^\s*<script/i)) {
|
|
425
|
+
html = ' ' + html;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
if (goog.editor.BrowserFeature.CONVERT_TO_B_AND_I_TAGS) {
|
|
429
|
+
// Some browsers (FF) can't undo strong/em in some cases, but can undo b/i!
|
|
430
|
+
html = html.replace(/<(\/?)strong([^\w])/gi, '<$1b$2');
|
|
431
|
+
html = html.replace(/<(\/?)em([^\w])/gi, '<$1i$2');
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
return html;
|
|
435
|
+
};
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* @inheritDoc
|
|
440
|
+
*/
|
|
441
|
+
goog.editor.plugins.BasicTextFormatter.prototype.cleanContentsDom =
|
|
442
|
+
function(fieldCopy) {
|
|
443
|
+
var images = fieldCopy.getElementsByTagName(goog.dom.TagName.IMG);
|
|
444
|
+
for (var i = 0, image; image = images[i]; i++) {
|
|
445
|
+
if (goog.editor.BrowserFeature.SHOWS_CUSTOM_ATTRS_IN_INNER_HTML) {
|
|
446
|
+
// Only need to remove these attributes in IE because
|
|
447
|
+
// Firefox and Safari don't show custom attributes in the innerHTML.
|
|
448
|
+
image.removeAttribute('tabIndex');
|
|
449
|
+
image.removeAttribute('tabIndexSet');
|
|
450
|
+
goog.removeUid(image);
|
|
451
|
+
|
|
452
|
+
// Declare oldTypeIndex for the compiler. The associated plugin may not be
|
|
453
|
+
// included in the compiled bundle.
|
|
454
|
+
/** @type {string} */ image.oldTabIndex;
|
|
455
|
+
|
|
456
|
+
// oldTabIndex will only be set if
|
|
457
|
+
// goog.editor.BrowserFeature.TABS_THROUGH_IMAGES is true and we're in
|
|
458
|
+
// P-on-enter mode.
|
|
459
|
+
if (image.oldTabIndex) {
|
|
460
|
+
image.tabIndex = image.oldTabIndex;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* @inheritDoc
|
|
469
|
+
*/
|
|
470
|
+
goog.editor.plugins.BasicTextFormatter.prototype.cleanContentsHtml =
|
|
471
|
+
function(html) {
|
|
472
|
+
if (goog.editor.BrowserFeature.MOVES_STYLE_TO_HEAD) {
|
|
473
|
+
// Safari creates a new <head> element for <style> tags, so prepend their
|
|
474
|
+
// contents to the output.
|
|
475
|
+
var heads = this.fieldObject.getEditableDomHelper().
|
|
476
|
+
getElementsByTagNameAndClass(goog.dom.TagName.HEAD);
|
|
477
|
+
var stylesHtmlArr = [];
|
|
478
|
+
|
|
479
|
+
// i starts at 1 so we don't copy in the original, legitimate <head>.
|
|
480
|
+
var numHeads = heads.length;
|
|
481
|
+
for (var i = 1; i < numHeads; ++i) {
|
|
482
|
+
var styles = heads[i].getElementsByTagName(goog.dom.TagName.STYLE);
|
|
483
|
+
var numStyles = styles.length;
|
|
484
|
+
for (var j = 0; j < numStyles; ++j) {
|
|
485
|
+
stylesHtmlArr.push(styles[j].outerHTML);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
return stylesHtmlArr.join('') + html;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
return html;
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* @inheritDoc
|
|
497
|
+
*/
|
|
498
|
+
goog.editor.plugins.BasicTextFormatter.prototype.handleKeyboardShortcut =
|
|
499
|
+
function(e, key, isModifierPressed) {
|
|
500
|
+
if (!isModifierPressed) {
|
|
501
|
+
return false;
|
|
502
|
+
}
|
|
503
|
+
var command;
|
|
504
|
+
switch (key) {
|
|
505
|
+
case 'b': // Ctrl+B
|
|
506
|
+
command = goog.editor.plugins.BasicTextFormatter.COMMAND.BOLD;
|
|
507
|
+
break;
|
|
508
|
+
case 'i': // Ctrl+I
|
|
509
|
+
command = goog.editor.plugins.BasicTextFormatter.COMMAND.ITALIC;
|
|
510
|
+
break;
|
|
511
|
+
case 'u': // Ctrl+U
|
|
512
|
+
command = goog.editor.plugins.BasicTextFormatter.COMMAND.UNDERLINE;
|
|
513
|
+
break;
|
|
514
|
+
case 's': // Ctrl+S
|
|
515
|
+
// TODO(user): This doesn't belong in here. Clients should handle
|
|
516
|
+
// this themselves.
|
|
517
|
+
// Catching control + s prevents the annoying browser save dialog
|
|
518
|
+
// from appearing.
|
|
519
|
+
return true;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
if (command) {
|
|
523
|
+
this.fieldObject.execCommand(command);
|
|
524
|
+
return true;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
return false;
|
|
528
|
+
};
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
// Helpers for execCommand
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Regular expression to match BRs in HTML. Saves the BRs' attributes in $1 for
|
|
536
|
+
* use with replace(). In non-IE browsers, does not match BRs adjacent to an
|
|
537
|
+
* opening or closing DIV or P tag, since nonrendered BR elements can occur at
|
|
538
|
+
* the end of block level containers in those browsers' editors.
|
|
539
|
+
* @type {RegExp}
|
|
540
|
+
* @private
|
|
541
|
+
*/
|
|
542
|
+
goog.editor.plugins.BasicTextFormatter.BR_REGEXP_ =
|
|
543
|
+
goog.userAgent.IE ? /<br([^\/>]*)\/?>/gi :
|
|
544
|
+
/<br([^\/>]*)\/?>(?!<\/(div|p)>)/gi;
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Convert BRs in the selection to divs.
|
|
549
|
+
* This is only intended to be used in IE and Opera.
|
|
550
|
+
* @return {boolean} Whether any BR's were converted.
|
|
551
|
+
* @private
|
|
552
|
+
*/
|
|
553
|
+
goog.editor.plugins.BasicTextFormatter.prototype.convertBreaksToDivs_ =
|
|
554
|
+
function() {
|
|
555
|
+
if (!goog.userAgent.IE && !goog.userAgent.OPERA) {
|
|
556
|
+
// This function is only supported on IE and Opera.
|
|
557
|
+
return false;
|
|
558
|
+
}
|
|
559
|
+
var range = this.getRange_();
|
|
560
|
+
var parent = range.getContainerElement();
|
|
561
|
+
var doc = this.getDocument_();
|
|
562
|
+
|
|
563
|
+
goog.editor.plugins.BasicTextFormatter.BR_REGEXP_.lastIndex = 0;
|
|
564
|
+
// Only mess with the HTML/selection if it contains a BR.
|
|
565
|
+
if (goog.editor.plugins.BasicTextFormatter.BR_REGEXP_.test(
|
|
566
|
+
parent.innerHTML)) {
|
|
567
|
+
// Insert temporary markers to remember the selection.
|
|
568
|
+
var savedRange = range.saveUsingCarets();
|
|
569
|
+
|
|
570
|
+
if (parent.tagName == goog.dom.TagName.P) {
|
|
571
|
+
// Can't append paragraphs to paragraph tags. Throws an exception in IE.
|
|
572
|
+
goog.editor.plugins.BasicTextFormatter.convertParagraphToDiv_(
|
|
573
|
+
parent, true);
|
|
574
|
+
} else {
|
|
575
|
+
// Used to do:
|
|
576
|
+
// IE: <div>foo<br>bar</div> --> <div>foo<p id="temp_br">bar</div>
|
|
577
|
+
// Opera: <div>foo<br>bar</div> --> <div>foo<p class="temp_br">bar</div>
|
|
578
|
+
// To fix bug 1939883, now does for both:
|
|
579
|
+
// <div>foo<br>bar</div> --> <div>foo<p trtempbr="temp_br">bar</div>
|
|
580
|
+
// TODO(user): Confirm if there's any way to skip this
|
|
581
|
+
// intermediate step of converting br's to p's before converting those to
|
|
582
|
+
// div's. The reason may be hidden in CLs 5332866 and 8530601.
|
|
583
|
+
var attribute = 'trtempbr';
|
|
584
|
+
var value = 'temp_br';
|
|
585
|
+
parent.innerHTML = parent.innerHTML.replace(
|
|
586
|
+
goog.editor.plugins.BasicTextFormatter.BR_REGEXP_,
|
|
587
|
+
'<p$1 ' + attribute + '="' + value + '">');
|
|
588
|
+
|
|
589
|
+
var paragraphs =
|
|
590
|
+
goog.array.toArray(parent.getElementsByTagName(goog.dom.TagName.P));
|
|
591
|
+
goog.iter.forEach(paragraphs, function(paragraph) {
|
|
592
|
+
if (paragraph.getAttribute(attribute) == value) {
|
|
593
|
+
paragraph.removeAttribute(attribute);
|
|
594
|
+
if (goog.string.isBreakingWhitespace(
|
|
595
|
+
goog.dom.getTextContent(paragraph))) {
|
|
596
|
+
// Prevent the empty blocks from collapsing.
|
|
597
|
+
// A <BR> is preferable because it doesn't result in any text being
|
|
598
|
+
// added to the "blank" line. In IE, however, it is possible to
|
|
599
|
+
// place the caret after the <br>, which effectively creates a
|
|
600
|
+
// visible line break. Because of this, we have to resort to using a
|
|
601
|
+
// in IE.
|
|
602
|
+
var child = goog.userAgent.IE ?
|
|
603
|
+
doc.createTextNode(goog.string.Unicode.NBSP) :
|
|
604
|
+
doc.createElement(goog.dom.TagName.BR);
|
|
605
|
+
paragraph.appendChild(child);
|
|
606
|
+
}
|
|
607
|
+
goog.editor.plugins.BasicTextFormatter.convertParagraphToDiv_(
|
|
608
|
+
paragraph);
|
|
609
|
+
}
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
// Select the previously selected text so we only listify
|
|
614
|
+
// the selected portion and maintain the user's selection.
|
|
615
|
+
savedRange.restore();
|
|
616
|
+
return true;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
return false;
|
|
620
|
+
};
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* Convert the given paragraph to being a div. This clobbers the
|
|
625
|
+
* passed-in node!
|
|
626
|
+
* This is only intended to be used in IE and Opera.
|
|
627
|
+
* @param {Node} paragraph Paragragh to convert to a div.
|
|
628
|
+
* @param {boolean=} opt_convertBrs If true, also convert BRs to divs.
|
|
629
|
+
* @private
|
|
630
|
+
*/
|
|
631
|
+
goog.editor.plugins.BasicTextFormatter.convertParagraphToDiv_ =
|
|
632
|
+
function(paragraph, opt_convertBrs) {
|
|
633
|
+
if (!goog.userAgent.IE && !goog.userAgent.OPERA) {
|
|
634
|
+
// This function is only supported on IE and Opera.
|
|
635
|
+
return;
|
|
636
|
+
}
|
|
637
|
+
var outerHTML = paragraph.outerHTML.replace(/<(\/?)p/gi, '<$1div');
|
|
638
|
+
if (opt_convertBrs) {
|
|
639
|
+
// IE fills in the closing div tag if it's missing!
|
|
640
|
+
outerHTML = outerHTML.replace(
|
|
641
|
+
goog.editor.plugins.BasicTextFormatter.BR_REGEXP_,
|
|
642
|
+
'</div><div$1>');
|
|
643
|
+
}
|
|
644
|
+
if (goog.userAgent.OPERA && !/<\/div>$/i.test(outerHTML)) {
|
|
645
|
+
// Opera doesn't automatically add the closing tag, so add it if needed.
|
|
646
|
+
outerHTML += '</div>';
|
|
647
|
+
}
|
|
648
|
+
paragraph.outerHTML = outerHTML;
|
|
649
|
+
};
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* If this is a goog.editor.plugins.BasicTextFormatter.COMMAND,
|
|
654
|
+
* convert it to something that we can pass into execCommand,
|
|
655
|
+
* queryCommandState, etc.
|
|
656
|
+
*
|
|
657
|
+
* TODO(user): Consider doing away with the + and converter completely.
|
|
658
|
+
*
|
|
659
|
+
* @param {goog.editor.plugins.BasicTextFormatter.COMMAND|string}
|
|
660
|
+
* command A command key.
|
|
661
|
+
* @return {string} The equivalent execCommand command.
|
|
662
|
+
* @private
|
|
663
|
+
*/
|
|
664
|
+
goog.editor.plugins.BasicTextFormatter.convertToRealExecCommand_ = function(
|
|
665
|
+
command) {
|
|
666
|
+
return command.indexOf('+') == 0 ? command.substring(1) : command;
|
|
667
|
+
};
|
|
668
|
+
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* Justify the text in the selection.
|
|
672
|
+
* @param {string} command The type of justification to perform.
|
|
673
|
+
* @private
|
|
674
|
+
*/
|
|
675
|
+
goog.editor.plugins.BasicTextFormatter.prototype.justify_ = function(command) {
|
|
676
|
+
this.execCommandHelper_(command, null, false, true);
|
|
677
|
+
// Firefox cannot justify divs. In fact, justifying divs results in removing
|
|
678
|
+
// the divs and replacing them with brs. So "<div>foo</div><div>bar</div>"
|
|
679
|
+
// becomes "foo<br>bar" after alignment is applied. However, if you justify
|
|
680
|
+
// again, then you get "<div style='text-align: right'>foo<br>bar</div>",
|
|
681
|
+
// which at least looks visually correct. Since justification is (normally)
|
|
682
|
+
// idempotent, it isn't a problem when the selection does not contain divs to
|
|
683
|
+
// apply justifcation again.
|
|
684
|
+
if (goog.userAgent.GECKO) {
|
|
685
|
+
this.execCommandHelper_(command, null, false, true);
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
// Convert all block elements in the selection to use CSS text-align
|
|
689
|
+
// instead of the align property. This works better because the align
|
|
690
|
+
// property is overridden by the CSS text-align property.
|
|
691
|
+
//
|
|
692
|
+
// Only for browsers that can't handle this by the styleWithCSS execCommand,
|
|
693
|
+
// which allows us to specify if we should insert align or text-align.
|
|
694
|
+
// TODO(user): What about WebKit or Opera?
|
|
695
|
+
if (!(goog.editor.BrowserFeature.HAS_STYLE_WITH_CSS &&
|
|
696
|
+
goog.userAgent.GECKO)) {
|
|
697
|
+
goog.iter.forEach(this.fieldObject.getRange(),
|
|
698
|
+
goog.editor.plugins.BasicTextFormatter.convertContainerToTextAlign_);
|
|
699
|
+
}
|
|
700
|
+
};
|
|
701
|
+
|
|
702
|
+
|
|
703
|
+
/**
|
|
704
|
+
* Converts the block element containing the given node to use CSS text-align
|
|
705
|
+
* instead of the align property.
|
|
706
|
+
* @param {Node} node The node to convert the container of.
|
|
707
|
+
* @private
|
|
708
|
+
*/
|
|
709
|
+
goog.editor.plugins.BasicTextFormatter.convertContainerToTextAlign_ =
|
|
710
|
+
function(node) {
|
|
711
|
+
var container = goog.editor.style.getContainer(node);
|
|
712
|
+
|
|
713
|
+
// TODO(user): Fix this so that it doesn't screw up tables.
|
|
714
|
+
if (container.align) {
|
|
715
|
+
container.style.textAlign = container.align;
|
|
716
|
+
container.removeAttribute('align');
|
|
717
|
+
}
|
|
718
|
+
};
|
|
719
|
+
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* Perform an execCommand on the active document.
|
|
723
|
+
* @param {string} command The command to execute.
|
|
724
|
+
* @param {string|number|boolean|null=} opt_value Optional value.
|
|
725
|
+
* @param {boolean=} opt_preserveDir Set true to make sure that command does not
|
|
726
|
+
* change directionality of the selected text (works only if all selected
|
|
727
|
+
* text has the same directionality, otherwise ignored). Should not be true
|
|
728
|
+
* if bidi plugin is not loaded.
|
|
729
|
+
* @param {boolean=} opt_styleWithCss Set to true to ask the browser to use CSS
|
|
730
|
+
* to perform the execCommand.
|
|
731
|
+
* @private
|
|
732
|
+
*/
|
|
733
|
+
goog.editor.plugins.BasicTextFormatter.prototype.execCommandHelper_ = function(
|
|
734
|
+
command, opt_value, opt_preserveDir, opt_styleWithCss) {
|
|
735
|
+
// There is a bug in FF: some commands do not preserve attributes of the
|
|
736
|
+
// block-level elements they replace.
|
|
737
|
+
// This (among the rest) leads to loss of directionality information.
|
|
738
|
+
// For now we use a hack (when opt_preserveDir==true) to avoid this
|
|
739
|
+
// directionality problem in the simplest cases.
|
|
740
|
+
// Known affected commands: formatBlock, insertOrderedList,
|
|
741
|
+
// insertUnorderedList, indent, outdent.
|
|
742
|
+
// A similar problem occurs in IE when insertOrderedList or
|
|
743
|
+
// insertUnorderedList remove existing list.
|
|
744
|
+
var dir = null;
|
|
745
|
+
if (opt_preserveDir) {
|
|
746
|
+
dir =
|
|
747
|
+
this.fieldObject.queryCommandValue(
|
|
748
|
+
goog.editor.Command.DIR_RTL) ? 'rtl' :
|
|
749
|
+
this.fieldObject.queryCommandValue(
|
|
750
|
+
goog.editor.Command.DIR_LTR) ? 'ltr' :
|
|
751
|
+
null;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
command = goog.editor.plugins.BasicTextFormatter.convertToRealExecCommand_(
|
|
755
|
+
command);
|
|
756
|
+
|
|
757
|
+
var endDiv, nbsp;
|
|
758
|
+
if (goog.userAgent.IE) {
|
|
759
|
+
var ret = this.applyExecCommandIEFixes_(command);
|
|
760
|
+
endDiv = ret[0];
|
|
761
|
+
nbsp = ret[1];
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
if (goog.userAgent.WEBKIT) {
|
|
765
|
+
endDiv = this.applyExecCommandSafariFixes_(command);
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
if (goog.userAgent.GECKO) {
|
|
769
|
+
this.applyExecCommandGeckoFixes_(command);
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
if (goog.editor.BrowserFeature.DOESNT_OVERRIDE_FONT_SIZE_IN_STYLE_ATTR &&
|
|
773
|
+
command.toLowerCase() == 'fontsize') {
|
|
774
|
+
this.removeFontSizeFromStyleAttrs_();
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
var doc = this.getDocument_();
|
|
778
|
+
if (opt_styleWithCss &&
|
|
779
|
+
goog.editor.BrowserFeature.HAS_STYLE_WITH_CSS) {
|
|
780
|
+
doc.execCommand('styleWithCSS', false, true);
|
|
781
|
+
if (goog.userAgent.OPERA) {
|
|
782
|
+
this.invalidateInlineCss_();
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
doc.execCommand(command, false, opt_value);
|
|
787
|
+
if (opt_styleWithCss &&
|
|
788
|
+
goog.editor.BrowserFeature.HAS_STYLE_WITH_CSS) {
|
|
789
|
+
// If we enabled styleWithCSS, turn it back off.
|
|
790
|
+
doc.execCommand('styleWithCSS', false, false);
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
if (goog.userAgent.WEBKIT && !goog.userAgent.isVersion('526') &&
|
|
794
|
+
command.toLowerCase() == 'formatblock' &&
|
|
795
|
+
opt_value && /^[<]?h\d[>]?$/i.test(opt_value)) {
|
|
796
|
+
this.cleanUpSafariHeadings_();
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
if (/insert(un)?orderedlist/i.test(command)) {
|
|
800
|
+
// NOTE(user): This doesn't check queryCommandState because it seems to
|
|
801
|
+
// lie. Also, this runs for insertunorderedlist so that the the list
|
|
802
|
+
// isn't made up of an <ul> for each <li> - even though it looks the same,
|
|
803
|
+
// the markup is disgusting.
|
|
804
|
+
if (goog.userAgent.WEBKIT) {
|
|
805
|
+
this.fixSafariLists_();
|
|
806
|
+
}
|
|
807
|
+
if (goog.userAgent.IE) {
|
|
808
|
+
this.fixIELists_();
|
|
809
|
+
|
|
810
|
+
if (nbsp) {
|
|
811
|
+
// Remove the text node, if applicable. Do not try to instead clobber
|
|
812
|
+
// the contents of the text node if it was added, or the same invalid
|
|
813
|
+
// node thing as above will happen. The error won't happen here, it
|
|
814
|
+
// will happen after you hit enter and then do anything that loops
|
|
815
|
+
// through the dom and tries to read that node.
|
|
816
|
+
goog.dom.removeNode(nbsp);
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
if (endDiv) {
|
|
822
|
+
// Remove the dummy div.
|
|
823
|
+
goog.dom.removeNode(endDiv);
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
// Restore directionality if required and only when unambigous (dir!=null).
|
|
827
|
+
if (dir) {
|
|
828
|
+
this.fieldObject.execCommand(dir);
|
|
829
|
+
}
|
|
830
|
+
};
|
|
831
|
+
|
|
832
|
+
|
|
833
|
+
/**
|
|
834
|
+
* Applies a background color to a selection when the browser can't do the job.
|
|
835
|
+
*
|
|
836
|
+
* NOTE(nicksantos): If you think this is hacky, you should try applying
|
|
837
|
+
* background color in Opera. It made me cry.
|
|
838
|
+
*
|
|
839
|
+
* @param {string} bgColor backgroundColor from .formatText to .execCommand.
|
|
840
|
+
* @private
|
|
841
|
+
*/
|
|
842
|
+
goog.editor.plugins.BasicTextFormatter.prototype.applyBgColorManually_ =
|
|
843
|
+
function(bgColor) {
|
|
844
|
+
var needsSpaceInTextNode = goog.userAgent.GECKO;
|
|
845
|
+
var range = this.fieldObject.getRange();
|
|
846
|
+
var textNode;
|
|
847
|
+
var parentTag;
|
|
848
|
+
if (range && range.isCollapsed()) {
|
|
849
|
+
// Hack to handle Firefox bug:
|
|
850
|
+
// https://bugzilla.mozilla.org/show_bug.cgi?id=279330
|
|
851
|
+
// execCommand hiliteColor in Firefox on collapsed selection creates
|
|
852
|
+
// a font tag onkeypress
|
|
853
|
+
textNode = this.getFieldDomHelper().
|
|
854
|
+
createTextNode(needsSpaceInTextNode ? ' ' : '');
|
|
855
|
+
|
|
856
|
+
var containerNode = range.getStartNode();
|
|
857
|
+
// Check if we're inside a tag that contains the cursor and nothing else;
|
|
858
|
+
// if we are, don't create a dummySpan. Just use this containing tag to
|
|
859
|
+
// hide the 1-space selection.
|
|
860
|
+
// If the user sets a background color on a collapsed selection, then sets
|
|
861
|
+
// another one immediately, we get a span tag with a single empty TextNode.
|
|
862
|
+
// If the user sets a background color, types, then backspaces, we get a
|
|
863
|
+
// span tag with nothing inside it (container is the span).
|
|
864
|
+
parentTag = containerNode.nodeType == goog.dom.NodeType.ELEMENT ?
|
|
865
|
+
containerNode : containerNode.parentNode;
|
|
866
|
+
|
|
867
|
+
if (parentTag.innerHTML == '') {
|
|
868
|
+
// There's an Element to work with
|
|
869
|
+
// make the space character invisible using a CSS indent hack
|
|
870
|
+
parentTag.style.textIndent = '-10000px';
|
|
871
|
+
parentTag.appendChild(textNode);
|
|
872
|
+
} else {
|
|
873
|
+
// No Element to work with; make one
|
|
874
|
+
// create a span with a space character inside
|
|
875
|
+
// make the space character invisible using a CSS indent hack
|
|
876
|
+
parentTag = this.getFieldDomHelper().createDom('span',
|
|
877
|
+
{'style': 'text-indent:-10000px'}, textNode);
|
|
878
|
+
range.replaceContentsWithNode(parentTag);
|
|
879
|
+
}
|
|
880
|
+
goog.dom.Range.createFromNodeContents(textNode).select();
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
this.execCommandHelper_('hiliteColor', bgColor, false, true);
|
|
884
|
+
|
|
885
|
+
if (textNode) {
|
|
886
|
+
// eliminate the space if necessary.
|
|
887
|
+
if (needsSpaceInTextNode) {
|
|
888
|
+
textNode.data = '';
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
// eliminate the hack.
|
|
892
|
+
parentTag.style.textIndent = '';
|
|
893
|
+
// execCommand modified our span so we leave it in place.
|
|
894
|
+
}
|
|
895
|
+
};
|
|
896
|
+
|
|
897
|
+
|
|
898
|
+
/**
|
|
899
|
+
* Toggle link for the current selection:
|
|
900
|
+
* If selection contains a link, unlink it, return null.
|
|
901
|
+
* Otherwise, make selection into a link, return the link.
|
|
902
|
+
* @param {string=} opt_target Target for the link.
|
|
903
|
+
* @return {goog.editor.Link?} The resulting link, or null if a link was
|
|
904
|
+
* removed.
|
|
905
|
+
* @private
|
|
906
|
+
*/
|
|
907
|
+
goog.editor.plugins.BasicTextFormatter.prototype.toggleLink_ = function(
|
|
908
|
+
opt_target) {
|
|
909
|
+
if (!this.fieldObject.isSelectionEditable()) {
|
|
910
|
+
this.focusField_();
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
var range = this.getRange_();
|
|
914
|
+
// Since we wrap images in links, its possible that the user selected an
|
|
915
|
+
// image and clicked link, in which case we want to actually use the
|
|
916
|
+
// image as the selection.
|
|
917
|
+
var parent = range && range.getContainerElement();
|
|
918
|
+
var link = /** @type {Element} */ (
|
|
919
|
+
goog.dom.getAncestorByTagNameAndClass(parent, goog.dom.TagName.A));
|
|
920
|
+
if (link && goog.editor.node.isEditable(link)) {
|
|
921
|
+
goog.dom.flattenElement(link);
|
|
922
|
+
} else {
|
|
923
|
+
var editableLink = this.createLink_(range, '/', opt_target);
|
|
924
|
+
if (editableLink) {
|
|
925
|
+
if (!this.fieldObject.execCommand(goog.editor.Command.MODAL_LINK_EDITOR,
|
|
926
|
+
editableLink)) {
|
|
927
|
+
var url = this.fieldObject.getAppWindow().prompt(
|
|
928
|
+
goog.ui.editor.messages.MSG_LINK_TO, 'http://');
|
|
929
|
+
if (url) {
|
|
930
|
+
editableLink.setTextAndUrl(editableLink.getCurrentText() || url, url);
|
|
931
|
+
editableLink.placeCursorRightOf();
|
|
932
|
+
} else {
|
|
933
|
+
var savedRange = goog.editor.range.saveUsingNormalizedCarets(
|
|
934
|
+
goog.dom.Range.createFromNodeContents(editableLink.getAnchor()));
|
|
935
|
+
editableLink.removeLink();
|
|
936
|
+
savedRange.restore().select();
|
|
937
|
+
return null;
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
return editableLink;
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
return null;
|
|
944
|
+
};
|
|
945
|
+
|
|
946
|
+
|
|
947
|
+
/**
|
|
948
|
+
* Create a link out of the current selection. If nothing is selected, insert
|
|
949
|
+
* a new link. Otherwise, enclose the selection in a link.
|
|
950
|
+
* @param {goog.dom.AbstractRange} range The closure range object for the
|
|
951
|
+
* current selection.
|
|
952
|
+
* @param {string} url The url to link to.
|
|
953
|
+
* @param {string=} opt_target Target for the link.
|
|
954
|
+
* @return {goog.editor.Link?} The newly created link.
|
|
955
|
+
* @private
|
|
956
|
+
*/
|
|
957
|
+
goog.editor.plugins.BasicTextFormatter.prototype.createLink_ = function(range,
|
|
958
|
+
url, opt_target) {
|
|
959
|
+
// TODO(robbyw): Handle multi-line links without requiring crazy hacks!
|
|
960
|
+
var anchor = null;
|
|
961
|
+
var parent = range && range.getContainerElement();
|
|
962
|
+
// We do not yet support creating links around images. Instead of throwing
|
|
963
|
+
// lots of js errors, just fail silently.
|
|
964
|
+
// TODO(user): Add support for linking images.
|
|
965
|
+
if (parent && parent.tagName == goog.dom.TagName.IMG) {
|
|
966
|
+
return null;
|
|
967
|
+
}
|
|
968
|
+
if (range && range.isCollapsed()) {
|
|
969
|
+
var textRange = range.getTextRange(0).getBrowserRangeObject();
|
|
970
|
+
if (goog.editor.BrowserFeature.HAS_W3C_RANGES) {
|
|
971
|
+
anchor = this.getFieldDomHelper().createElement(goog.dom.TagName.A);
|
|
972
|
+
textRange.insertNode(anchor);
|
|
973
|
+
} else if (goog.editor.BrowserFeature.HAS_IE_RANGES) {
|
|
974
|
+
// TODO: Use goog.dom.AbstractRange's surroundContents
|
|
975
|
+
textRange.pasteHTML("<a id='newLink'></a>");
|
|
976
|
+
anchor = this.getFieldDomHelper().getElement('newLink');
|
|
977
|
+
anchor.removeAttribute('id');
|
|
978
|
+
}
|
|
979
|
+
} else {
|
|
980
|
+
// Create a unique identifier for the link so we can retrieve it later.
|
|
981
|
+
// execCommand doesn't return the link to us, and we need a way to find
|
|
982
|
+
// the newly created link in the dom, and the url is the only property
|
|
983
|
+
// we have control over, so we set that to be unique and then find it.
|
|
984
|
+
var uniqueId = goog.string.createUniqueString();
|
|
985
|
+
this.execCommandHelper_('CreateLink', uniqueId);
|
|
986
|
+
var setHrefAndLink = function(element, index, arr) {
|
|
987
|
+
// We can't do straight comparision since the href can contain the
|
|
988
|
+
// absolute url.
|
|
989
|
+
if (goog.string.endsWith(element.href, uniqueId)) {
|
|
990
|
+
anchor = element;
|
|
991
|
+
}
|
|
992
|
+
};
|
|
993
|
+
|
|
994
|
+
goog.array.forEach(this.fieldObject.getElement().getElementsByTagName(
|
|
995
|
+
goog.dom.TagName.A), setHrefAndLink);
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
return goog.editor.Link.createNewLink(
|
|
999
|
+
/** @type {HTMLAnchorElement} */ (anchor), url, opt_target);
|
|
1000
|
+
};
|
|
1001
|
+
|
|
1002
|
+
|
|
1003
|
+
//---------------------------------------------------------------------
|
|
1004
|
+
// browser fixes
|
|
1005
|
+
|
|
1006
|
+
|
|
1007
|
+
/**
|
|
1008
|
+
* The following execCommands are "broken" in some way - in IE they allow
|
|
1009
|
+
* the nodes outside the contentEditable region to get modified (see
|
|
1010
|
+
* execCommand below for more details).
|
|
1011
|
+
* @const
|
|
1012
|
+
* @private
|
|
1013
|
+
*/
|
|
1014
|
+
goog.editor.plugins.BasicTextFormatter.brokenExecCommandsIE_ = {
|
|
1015
|
+
'indent' : 1,
|
|
1016
|
+
'outdent' : 1,
|
|
1017
|
+
'insertOrderedList' : 1,
|
|
1018
|
+
'insertUnorderedList' : 1,
|
|
1019
|
+
'justifyCenter' : 1,
|
|
1020
|
+
'justifyFull' : 1,
|
|
1021
|
+
'justifyRight': 1,
|
|
1022
|
+
'justifyLeft': 1,
|
|
1023
|
+
'ltr' : 1,
|
|
1024
|
+
'rtl' : 1
|
|
1025
|
+
};
|
|
1026
|
+
|
|
1027
|
+
|
|
1028
|
+
/**
|
|
1029
|
+
* When the following commands are executed while the selection is
|
|
1030
|
+
* inside a blockquote, they hose the blockquote tag in weird and
|
|
1031
|
+
* unintuitive ways.
|
|
1032
|
+
* @const
|
|
1033
|
+
* @private
|
|
1034
|
+
*/
|
|
1035
|
+
goog.editor.plugins.BasicTextFormatter.blockquoteHatingCommandsIE_ = {
|
|
1036
|
+
'insertOrderedList' : 1,
|
|
1037
|
+
'insertUnorderedList' : 1
|
|
1038
|
+
};
|
|
1039
|
+
|
|
1040
|
+
|
|
1041
|
+
/**
|
|
1042
|
+
* Makes sure that superscript is removed before applying subscript, and vice
|
|
1043
|
+
* versa. Fixes {@link http://buganizer/issue?id=1173491} .
|
|
1044
|
+
* @param {goog.editor.plugins.BasicTextFormatter.COMMAND} command The command
|
|
1045
|
+
* being applied, either SUBSCRIPT or SUPERSCRIPT.
|
|
1046
|
+
* @private
|
|
1047
|
+
*/
|
|
1048
|
+
goog.editor.plugins.BasicTextFormatter.
|
|
1049
|
+
prototype.applySubscriptSuperscriptWorkarounds_ = function(command) {
|
|
1050
|
+
if (!this.queryCommandValue(command)) {
|
|
1051
|
+
// The current selection doesn't currently have the requested
|
|
1052
|
+
// command, so we are applying it as opposed to removing it.
|
|
1053
|
+
// (Note that queryCommandValue() will only return true if the
|
|
1054
|
+
// command is applied to the whole selection, not just part of it.
|
|
1055
|
+
// In this case it is fine because only if the whole selection has
|
|
1056
|
+
// the command applied will we be removing it and thus skipping the
|
|
1057
|
+
// removal of the opposite command.)
|
|
1058
|
+
var oppositeCommand =
|
|
1059
|
+
(command == goog.editor.plugins.BasicTextFormatter.COMMAND.SUBSCRIPT ?
|
|
1060
|
+
goog.editor.plugins.BasicTextFormatter.COMMAND.SUPERSCRIPT :
|
|
1061
|
+
goog.editor.plugins.BasicTextFormatter.COMMAND.SUBSCRIPT);
|
|
1062
|
+
var oppositeExecCommand = goog.editor.plugins.BasicTextFormatter.
|
|
1063
|
+
convertToRealExecCommand_(oppositeCommand);
|
|
1064
|
+
// Executing the opposite command on a selection that already has it
|
|
1065
|
+
// applied will cancel it out. But if the selection only has the
|
|
1066
|
+
// opposite command applied to a part of it, the browser will
|
|
1067
|
+
// normalize the selection to have the opposite command applied on
|
|
1068
|
+
// the whole of it.
|
|
1069
|
+
if (!this.queryCommandValue(oppositeCommand)) {
|
|
1070
|
+
// The selection doesn't have the opposite command applied to the
|
|
1071
|
+
// whole of it, so let's exec the opposite command to normalize
|
|
1072
|
+
// the selection.
|
|
1073
|
+
// Note: since we know both subscript and superscript commands
|
|
1074
|
+
// will boil down to a simple call to the browser's execCommand(),
|
|
1075
|
+
// for performance reasons we can do that directly instead of
|
|
1076
|
+
// calling execCommandHelper_(). However this is a potential for
|
|
1077
|
+
// bugs if the implementation of execCommandHelper_() is changed
|
|
1078
|
+
// to do something more int eh case of subscript and superscript.
|
|
1079
|
+
this.getDocument_().execCommand(oppositeExecCommand, false, null);
|
|
1080
|
+
}
|
|
1081
|
+
// Now that we know the whole selection has the opposite command
|
|
1082
|
+
// applied, we exec it a second time to properly remove it.
|
|
1083
|
+
this.getDocument_().execCommand(oppositeExecCommand, false, null);
|
|
1084
|
+
}
|
|
1085
|
+
};
|
|
1086
|
+
|
|
1087
|
+
|
|
1088
|
+
/**
|
|
1089
|
+
* Removes inline font-size styles from elements fully contained in the
|
|
1090
|
+
* selection, so the font tags produced by execCommand work properly.
|
|
1091
|
+
* See {@bug 1286408}.
|
|
1092
|
+
* @private
|
|
1093
|
+
*/
|
|
1094
|
+
goog.editor.plugins.BasicTextFormatter.prototype.removeFontSizeFromStyleAttrs_ =
|
|
1095
|
+
function() {
|
|
1096
|
+
// Expand the range so that we consider surrounding tags. E.g. if only the
|
|
1097
|
+
// text node inside a span is selected, the browser could wrap a font tag
|
|
1098
|
+
// around the span and leave the selection such that only the text node is
|
|
1099
|
+
// found when looking inside the range, not the span.
|
|
1100
|
+
var range = goog.editor.range.expand(this.fieldObject.getRange(),
|
|
1101
|
+
this.fieldObject.getElement());
|
|
1102
|
+
goog.iter.forEach(goog.iter.filter(range, function(tag, dummy, iter) {
|
|
1103
|
+
return iter.isStartTag() && range.containsNode(tag);
|
|
1104
|
+
}), function(node) {
|
|
1105
|
+
goog.style.setStyle(node, 'font-size', '');
|
|
1106
|
+
// Gecko doesn't remove empty style tags.
|
|
1107
|
+
if (goog.userAgent.GECKO &&
|
|
1108
|
+
node.style.length == 0 && node.getAttribute('style') != null) {
|
|
1109
|
+
node.removeAttribute('style');
|
|
1110
|
+
}
|
|
1111
|
+
});
|
|
1112
|
+
};
|
|
1113
|
+
|
|
1114
|
+
|
|
1115
|
+
/**
|
|
1116
|
+
* Apply pre-execCommand fixes for IE.
|
|
1117
|
+
* @param {string} command The command to execute.
|
|
1118
|
+
* @return {Array.<Node>} Array of nodes to be removed after the execCommand.
|
|
1119
|
+
* Will never be longer than 2 elements.
|
|
1120
|
+
* @private
|
|
1121
|
+
*/
|
|
1122
|
+
goog.editor.plugins.BasicTextFormatter.prototype.applyExecCommandIEFixes_ =
|
|
1123
|
+
function(command) {
|
|
1124
|
+
// IE has a crazy bug where executing list commands
|
|
1125
|
+
// around blockquotes cause the blockquotes to get transformed
|
|
1126
|
+
// into "<OL><OL>" or "<UL><UL>" tags.
|
|
1127
|
+
var toRemove = [];
|
|
1128
|
+
var endDiv = null;
|
|
1129
|
+
var range = this.getRange_();
|
|
1130
|
+
var dh = this.getFieldDomHelper();
|
|
1131
|
+
if (command in
|
|
1132
|
+
goog.editor.plugins.BasicTextFormatter.blockquoteHatingCommandsIE_) {
|
|
1133
|
+
var parent = range && range.getContainerElement();
|
|
1134
|
+
if (parent) {
|
|
1135
|
+
var blockquotes = goog.dom.getElementsByTagNameAndClass(
|
|
1136
|
+
goog.dom.TagName.BLOCKQUOTE, null, parent);
|
|
1137
|
+
|
|
1138
|
+
// If a blockquote contains the selection, the fix is easy:
|
|
1139
|
+
// add a dummy div to the blockquote that isn't in the current selection.
|
|
1140
|
+
//
|
|
1141
|
+
// if the selection contains a blockquote,
|
|
1142
|
+
// there appears to be no easy way to protect it from getting mangled.
|
|
1143
|
+
// For now, we're just going to punt on this and try to
|
|
1144
|
+
// adjust the selection so that IE does something reasonable.
|
|
1145
|
+
//
|
|
1146
|
+
// TODO(nicksantos): Find a better fix for this.
|
|
1147
|
+
var bq;
|
|
1148
|
+
for (var i = 0; i < blockquotes.length; i++) {
|
|
1149
|
+
if (range.containsNode(blockquotes[i])) {
|
|
1150
|
+
bq = blockquotes[i];
|
|
1151
|
+
break;
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
var bqThatNeedsDummyDiv =
|
|
1156
|
+
bq || goog.dom.getAncestorByTagNameAndClass(parent, 'BLOCKQUOTE');
|
|
1157
|
+
if (bqThatNeedsDummyDiv) {
|
|
1158
|
+
endDiv = dh.createDom('div', {style: 'height:0'});
|
|
1159
|
+
goog.dom.appendChild(bqThatNeedsDummyDiv, endDiv);
|
|
1160
|
+
toRemove.push(endDiv);
|
|
1161
|
+
|
|
1162
|
+
if (bq) {
|
|
1163
|
+
range = goog.dom.Range.createFromNodes(bq, 0, endDiv, 0);
|
|
1164
|
+
} else if (range.containsNode(endDiv)) {
|
|
1165
|
+
// the selection might be the entire blockquote, and
|
|
1166
|
+
// it's important that endDiv not be in the selection.
|
|
1167
|
+
range = goog.dom.Range.createFromNodes(
|
|
1168
|
+
range.getStartNode(), range.getStartOffset(),
|
|
1169
|
+
endDiv, 0);
|
|
1170
|
+
}
|
|
1171
|
+
range.select();
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
// IE has a crazy bug where certain block execCommands cause it to mess with
|
|
1177
|
+
// the DOM nodes above the contentEditable element if the selection contains
|
|
1178
|
+
// or partially contains the last block element in the contentEditable
|
|
1179
|
+
// element.
|
|
1180
|
+
// Known commands: Indent, outdent, insertorderedlist, insertunorderedlist,
|
|
1181
|
+
// Justify (all of them)
|
|
1182
|
+
|
|
1183
|
+
// Both of the above are "solved" by appending a dummy div to the field
|
|
1184
|
+
// before the execCommand and removing it after, but we don't need to do this
|
|
1185
|
+
// if we've alread added a dummy div somewhere else.
|
|
1186
|
+
var fieldObject = this.fieldObject;
|
|
1187
|
+
if (!fieldObject.usesIframe() && !endDiv) {
|
|
1188
|
+
if (command in
|
|
1189
|
+
goog.editor.plugins.BasicTextFormatter.brokenExecCommandsIE_) {
|
|
1190
|
+
var field = fieldObject.getElement();
|
|
1191
|
+
|
|
1192
|
+
// If the field is totally empty, or if the field contains only text nodes
|
|
1193
|
+
// and the cursor is at the end of the field, then IE stills walks outside
|
|
1194
|
+
// the contentEditable region and destroys things AND justify will not
|
|
1195
|
+
// work. This is "solved" by adding a text node into the end of the
|
|
1196
|
+
// field and moving the cursor before it.
|
|
1197
|
+
if (range && range.isCollapsed() &&
|
|
1198
|
+
!goog.dom.getFirstElementChild(field)) {
|
|
1199
|
+
// The problem only occurs if the selection is at the end of the field.
|
|
1200
|
+
var selection = range.getTextRange(0).getBrowserRangeObject();
|
|
1201
|
+
var testRange = selection.duplicate();
|
|
1202
|
+
testRange.moveToElementText(field);
|
|
1203
|
+
testRange.collapse(false);
|
|
1204
|
+
|
|
1205
|
+
if (testRange.isEqual(selection)) {
|
|
1206
|
+
// For reasons I really don't understand, if you use a breaking space
|
|
1207
|
+
// here, either " " or String.fromCharCode(32), this textNode becomes
|
|
1208
|
+
// corrupted, only after you hit ENTER to split it. It exists in the
|
|
1209
|
+
// dom in that its parent has it as childNode and the parent's
|
|
1210
|
+
// innerText is correct, but the node itself throws invalid argument
|
|
1211
|
+
// errors when you try to access its data, parentNode, nextSibling,
|
|
1212
|
+
// previousSibling or most other properties. WTF.
|
|
1213
|
+
var nbsp = dh.createTextNode(goog.string.Unicode.NBSP);
|
|
1214
|
+
field.appendChild(nbsp);
|
|
1215
|
+
selection.move('character', 1);
|
|
1216
|
+
selection.move('character', -1);
|
|
1217
|
+
selection.select();
|
|
1218
|
+
toRemove.push(nbsp);
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
endDiv = dh.createDom('div', {style: 'height:0'});
|
|
1223
|
+
goog.dom.appendChild(field, endDiv);
|
|
1224
|
+
toRemove.push(endDiv);
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
return toRemove;
|
|
1229
|
+
};
|
|
1230
|
+
|
|
1231
|
+
|
|
1232
|
+
/**
|
|
1233
|
+
* Fix a ridiculous Safari bug: the first letters of new headings
|
|
1234
|
+
* somehow retain their original font size and weight if multiple lines are
|
|
1235
|
+
* selected during the execCommand that turns them into headings.
|
|
1236
|
+
* The solution is to strip these styles which are normally stripped when
|
|
1237
|
+
* making things headings anyway.
|
|
1238
|
+
* @private
|
|
1239
|
+
*/
|
|
1240
|
+
goog.editor.plugins.BasicTextFormatter.prototype.cleanUpSafariHeadings_ =
|
|
1241
|
+
function() {
|
|
1242
|
+
goog.iter.forEach(this.getRange_(), function(node) {
|
|
1243
|
+
if (node.className == 'Apple-style-span') {
|
|
1244
|
+
// These shouldn't persist after creating headings via
|
|
1245
|
+
// a FormatBlock execCommand.
|
|
1246
|
+
node.style.fontSize = '';
|
|
1247
|
+
node.style.fontWeight = '';
|
|
1248
|
+
}
|
|
1249
|
+
});
|
|
1250
|
+
};
|
|
1251
|
+
|
|
1252
|
+
|
|
1253
|
+
/**
|
|
1254
|
+
* Prevent Safari from making each list item be "1" when converting from
|
|
1255
|
+
* unordered to ordered lists.
|
|
1256
|
+
* (see https://bugs.webkit.org/show_bug.cgi?id=19539 )
|
|
1257
|
+
* @private
|
|
1258
|
+
*/
|
|
1259
|
+
goog.editor.plugins.BasicTextFormatter.prototype.fixSafariLists_ = function() {
|
|
1260
|
+
var previousList = false;
|
|
1261
|
+
goog.iter.forEach(this.getRange_(), function(node) {
|
|
1262
|
+
var tagName = node.tagName;
|
|
1263
|
+
if (tagName == goog.dom.TagName.UL || tagName == goog.dom.TagName.OL) {
|
|
1264
|
+
// Don't disturb lists outside of the selection. If this is the first <ul>
|
|
1265
|
+
// or <ol> in the range, we don't really want to merge the previous list
|
|
1266
|
+
// into it, since that list isn't in the range.
|
|
1267
|
+
if (!previousList) {
|
|
1268
|
+
previousList = true;
|
|
1269
|
+
return;
|
|
1270
|
+
}
|
|
1271
|
+
// The lists must be siblings to be merged; otherwise, indented sublists
|
|
1272
|
+
// could be broken.
|
|
1273
|
+
var previousElementSibling = goog.dom.getPreviousElementSibling(node);
|
|
1274
|
+
if (!previousElementSibling) {
|
|
1275
|
+
return;
|
|
1276
|
+
}
|
|
1277
|
+
// Make sure there isn't text between the two lists before they are merged
|
|
1278
|
+
var range = node.ownerDocument.createRange();
|
|
1279
|
+
range.setStartAfter(previousElementSibling);
|
|
1280
|
+
range.setEndBefore(node);
|
|
1281
|
+
if (!goog.string.isEmpty(range.toString())) {
|
|
1282
|
+
return;
|
|
1283
|
+
}
|
|
1284
|
+
// Make sure both are lists of the same type (ordered or unordered)
|
|
1285
|
+
if (previousElementSibling.nodeName == node.nodeName) {
|
|
1286
|
+
// We must merge the previous list into this one. Moving around
|
|
1287
|
+
// the current node will break the iterator, so we can't merge
|
|
1288
|
+
// this list into the previous one.
|
|
1289
|
+
while (previousElementSibling.lastChild) {
|
|
1290
|
+
node.insertBefore(previousElementSibling.lastChild, node.firstChild);
|
|
1291
|
+
}
|
|
1292
|
+
previousElementSibling.parentNode.removeChild(previousElementSibling);
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
});
|
|
1296
|
+
};
|
|
1297
|
+
|
|
1298
|
+
|
|
1299
|
+
/**
|
|
1300
|
+
* Sane "type" attribute values for OL elements
|
|
1301
|
+
* @private
|
|
1302
|
+
*/
|
|
1303
|
+
goog.editor.plugins.BasicTextFormatter.orderedListTypes_ = {
|
|
1304
|
+
'1' : 1,
|
|
1305
|
+
'a' : 1,
|
|
1306
|
+
'A' : 1,
|
|
1307
|
+
'i' : 1,
|
|
1308
|
+
'I' : 1
|
|
1309
|
+
};
|
|
1310
|
+
|
|
1311
|
+
|
|
1312
|
+
/**
|
|
1313
|
+
* Sane "type" attribute values for UL elements
|
|
1314
|
+
* @private
|
|
1315
|
+
*/
|
|
1316
|
+
goog.editor.plugins.BasicTextFormatter.unorderedListTypes_ = {
|
|
1317
|
+
'disc' : 1,
|
|
1318
|
+
'circle' : 1,
|
|
1319
|
+
'square' : 1
|
|
1320
|
+
};
|
|
1321
|
+
|
|
1322
|
+
|
|
1323
|
+
/**
|
|
1324
|
+
* Changing an OL to a UL (or the other way around) will fail if the list
|
|
1325
|
+
* has a type attribute (such as "UL type=disc" becoming "OL type=disc", which
|
|
1326
|
+
* is visually identical). Most browsers will remove the type attribute
|
|
1327
|
+
* automatically, but IE doesn't. This does it manually.
|
|
1328
|
+
* @private
|
|
1329
|
+
*/
|
|
1330
|
+
goog.editor.plugins.BasicTextFormatter.prototype.fixIELists_ = function() {
|
|
1331
|
+
// Find the lowest-level <ul> or <ol> that contains the entire range.
|
|
1332
|
+
var range = this.getRange_();
|
|
1333
|
+
var container = range && range.getContainer();
|
|
1334
|
+
while (container &&
|
|
1335
|
+
container.tagName != goog.dom.TagName.UL &&
|
|
1336
|
+
container.tagName != goog.dom.TagName.OL) {
|
|
1337
|
+
container = container.parentNode;
|
|
1338
|
+
}
|
|
1339
|
+
if (container) {
|
|
1340
|
+
// We want the parent node of the list so that we can grab it using
|
|
1341
|
+
// getElementsByTagName
|
|
1342
|
+
container = container.parentNode;
|
|
1343
|
+
}
|
|
1344
|
+
if (!container) return;
|
|
1345
|
+
var lists = goog.array.toArray(
|
|
1346
|
+
container.getElementsByTagName(goog.dom.TagName.UL));
|
|
1347
|
+
goog.array.extend(lists, goog.array.toArray(
|
|
1348
|
+
container.getElementsByTagName(goog.dom.TagName.OL)));
|
|
1349
|
+
// Fix the lists
|
|
1350
|
+
goog.array.forEach(lists, function(node) {
|
|
1351
|
+
var type = node.type;
|
|
1352
|
+
if (type) {
|
|
1353
|
+
var saneTypes =
|
|
1354
|
+
(node.tagName == goog.dom.TagName.UL ?
|
|
1355
|
+
goog.editor.plugins.BasicTextFormatter.unorderedListTypes_ :
|
|
1356
|
+
goog.editor.plugins.BasicTextFormatter.orderedListTypes_);
|
|
1357
|
+
if (!saneTypes[type]) {
|
|
1358
|
+
node.type = '';
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
});
|
|
1362
|
+
};
|
|
1363
|
+
|
|
1364
|
+
|
|
1365
|
+
/**
|
|
1366
|
+
* In WebKit, the following commands will modify the node with
|
|
1367
|
+
* contentEditable=true if there are no block-level elements.
|
|
1368
|
+
* @private
|
|
1369
|
+
*/
|
|
1370
|
+
goog.editor.plugins.BasicTextFormatter.brokenExecCommandsSafari_ = {
|
|
1371
|
+
'justifyCenter' : 1,
|
|
1372
|
+
'justifyFull' : 1,
|
|
1373
|
+
'justifyRight': 1,
|
|
1374
|
+
'justifyLeft': 1,
|
|
1375
|
+
'formatBlock' : 1
|
|
1376
|
+
};
|
|
1377
|
+
|
|
1378
|
+
|
|
1379
|
+
/**
|
|
1380
|
+
* In WebKit, the following commands can hang the browser if the selection
|
|
1381
|
+
* touches the beginning of the field.
|
|
1382
|
+
* https://bugs.webkit.org/show_bug.cgi?id=19735
|
|
1383
|
+
* @private
|
|
1384
|
+
*/
|
|
1385
|
+
goog.editor.plugins.BasicTextFormatter.hangingExecCommandWebkit_ = {
|
|
1386
|
+
'insertOrderedList': 1,
|
|
1387
|
+
'insertUnorderedList': 1
|
|
1388
|
+
};
|
|
1389
|
+
|
|
1390
|
+
|
|
1391
|
+
/**
|
|
1392
|
+
* Apply pre-execCommand fixes for Safari.
|
|
1393
|
+
* @param {string} command The command to execute.
|
|
1394
|
+
* @return {Element|undefined} The div added to the field.
|
|
1395
|
+
* @private
|
|
1396
|
+
*/
|
|
1397
|
+
goog.editor.plugins.BasicTextFormatter.prototype.applyExecCommandSafariFixes_ =
|
|
1398
|
+
function(command) {
|
|
1399
|
+
// See the comment on brokenExecCommandsSafari_
|
|
1400
|
+
var div;
|
|
1401
|
+
if (goog.editor.plugins.BasicTextFormatter.
|
|
1402
|
+
brokenExecCommandsSafari_[command]) {
|
|
1403
|
+
// Add a new div at the end of the field.
|
|
1404
|
+
// Safari knows that it would be wrong to apply text-align to the
|
|
1405
|
+
// contentEditable element if there are non-empty block nodes in the field,
|
|
1406
|
+
// because then it would align them too. So in this case, it will
|
|
1407
|
+
// enclose the current selection in a block node.
|
|
1408
|
+
div = this.getFieldDomHelper().createDom(
|
|
1409
|
+
'div', {'style': 'height: 0'}, 'x');
|
|
1410
|
+
goog.dom.appendChild(this.fieldObject.getElement(), div);
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
if (goog.editor.plugins.BasicTextFormatter.
|
|
1414
|
+
hangingExecCommandWebkit_[command]) {
|
|
1415
|
+
// Add a new div at the beginning of the field.
|
|
1416
|
+
var field = this.fieldObject.getElement();
|
|
1417
|
+
div = this.getFieldDomHelper().createDom(
|
|
1418
|
+
'div', {'style': 'height: 0'}, 'x');
|
|
1419
|
+
field.insertBefore(div, field.firstChild);
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
return div;
|
|
1423
|
+
};
|
|
1424
|
+
|
|
1425
|
+
|
|
1426
|
+
/**
|
|
1427
|
+
* Apply pre-execCommand fixes for Gecko.
|
|
1428
|
+
* @param {string} command The command to execute.
|
|
1429
|
+
* @private
|
|
1430
|
+
*/
|
|
1431
|
+
goog.editor.plugins.BasicTextFormatter.prototype.applyExecCommandGeckoFixes_ =
|
|
1432
|
+
function(command) {
|
|
1433
|
+
if (goog.userAgent.isVersion('1.9') &&
|
|
1434
|
+
command.toLowerCase() == 'formatblock') {
|
|
1435
|
+
// Firefox 3 and above throw a JS error for formatblock if the range is
|
|
1436
|
+
// a child of the body node. Changing the selection to the BR fixes the
|
|
1437
|
+
// problem.
|
|
1438
|
+
// See https://bugzilla.mozilla.org/show_bug.cgi?id=481696
|
|
1439
|
+
var range = this.getRange_();
|
|
1440
|
+
var startNode = range.getStartNode();
|
|
1441
|
+
if (range.isCollapsed() && startNode &&
|
|
1442
|
+
startNode.tagName == goog.dom.TagName.BODY) {
|
|
1443
|
+
var startOffset = range.getStartOffset();
|
|
1444
|
+
var childNode = startNode.childNodes[startOffset];
|
|
1445
|
+
if (childNode && childNode.tagName == goog.dom.TagName.BR) {
|
|
1446
|
+
// Change the range using getBrowserRange() because goog.dom.TextRange
|
|
1447
|
+
// will avoid setting <br>s directly.
|
|
1448
|
+
// @see goog.dom.TextRange#createFromNodes
|
|
1449
|
+
var browserRange = range.getBrowserRangeObject();
|
|
1450
|
+
browserRange.setStart(childNode, 0);
|
|
1451
|
+
browserRange.setEnd(childNode, 0);
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
};
|
|
1456
|
+
|
|
1457
|
+
|
|
1458
|
+
/**
|
|
1459
|
+
* Workaround for Opera bug CORE-23903. Opera sometimes fails to invalidate
|
|
1460
|
+
* serialized CSS or innerHTML for the DOM after certain execCommands when
|
|
1461
|
+
* styleWithCSS is on. Toggling an inline style on the elements fixes it.
|
|
1462
|
+
* TODO(user): Opera says they're going to prioritize a fix for this. Remove
|
|
1463
|
+
* this code once that fix is released.
|
|
1464
|
+
* @private
|
|
1465
|
+
*/
|
|
1466
|
+
goog.editor.plugins.BasicTextFormatter.prototype.invalidateInlineCss_ =
|
|
1467
|
+
function() {
|
|
1468
|
+
var ancestors = [];
|
|
1469
|
+
var ancestor = this.fieldObject.getRange().getContainerElement();
|
|
1470
|
+
do {
|
|
1471
|
+
ancestors.push(ancestor);
|
|
1472
|
+
} while (ancestor = ancestor.parentNode);
|
|
1473
|
+
var nodesInSelection = goog.iter.chain(
|
|
1474
|
+
goog.iter.toIterator(this.fieldObject.getRange()),
|
|
1475
|
+
goog.iter.toIterator(ancestors));
|
|
1476
|
+
var containersInSelection =
|
|
1477
|
+
goog.iter.filter(nodesInSelection, goog.editor.style.isContainer);
|
|
1478
|
+
goog.iter.forEach(containersInSelection, function(element) {
|
|
1479
|
+
var oldOutline = element.style.outline;
|
|
1480
|
+
element.style.outline = '0px solid red';
|
|
1481
|
+
element.style.outline = oldOutline;
|
|
1482
|
+
});
|
|
1483
|
+
};
|
|
1484
|
+
|
|
1485
|
+
|
|
1486
|
+
/**
|
|
1487
|
+
* Work around a Gecko bug that causes inserted lists to forget the current
|
|
1488
|
+
* font. This affects WebKit in the same way and Opera in a slightly different
|
|
1489
|
+
* way, but this workaround only works in Gecko.
|
|
1490
|
+
* WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=19653
|
|
1491
|
+
* Mozilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=439966
|
|
1492
|
+
* Opera bug: https://bugs.opera.com/show_bug.cgi?id=340392
|
|
1493
|
+
* TODO: work around this issue in WebKit and Opera as well.
|
|
1494
|
+
* @return {boolean} Whether the workaround was applied.
|
|
1495
|
+
* @private
|
|
1496
|
+
*/
|
|
1497
|
+
goog.editor.plugins.BasicTextFormatter.prototype.beforeInsertListGecko_ =
|
|
1498
|
+
function() {
|
|
1499
|
+
var tag = this.fieldObject.queryCommandValue(goog.editor.Command.DEFAULT_TAG);
|
|
1500
|
+
if (tag == goog.dom.TagName.P || tag == goog.dom.TagName.DIV) {
|
|
1501
|
+
return false;
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
// Prevent Firefox from forgetting current formatting
|
|
1505
|
+
// when creating a list.
|
|
1506
|
+
// The bug happens with a collapsed selection, but it won't
|
|
1507
|
+
// happen when text with the desired formatting is selected.
|
|
1508
|
+
// So, we insert some dummy text, insert the list,
|
|
1509
|
+
// then remove the dummy text (while preserving its formatting).
|
|
1510
|
+
// (This formatting bug also affects WebKit, but this fix
|
|
1511
|
+
// only seems to work in Firefox)
|
|
1512
|
+
var range = this.getRange_();
|
|
1513
|
+
if (range.isCollapsed() &&
|
|
1514
|
+
(range.getContainer().nodeType != goog.dom.NodeType.TEXT)) {
|
|
1515
|
+
var tempTextNode = this.getFieldDomHelper().
|
|
1516
|
+
createTextNode(goog.string.Unicode.NBSP);
|
|
1517
|
+
range.insertNode(tempTextNode, false);
|
|
1518
|
+
goog.dom.Range.createFromNodeContents(tempTextNode).select();
|
|
1519
|
+
return true;
|
|
1520
|
+
}
|
|
1521
|
+
return false;
|
|
1522
|
+
};
|
|
1523
|
+
|
|
1524
|
+
|
|
1525
|
+
// Helpers for queryCommandState
|
|
1526
|
+
|
|
1527
|
+
|
|
1528
|
+
/**
|
|
1529
|
+
* Get the toolbar state for the block-level elements in the given range.
|
|
1530
|
+
* @param {goog.dom.AbstractRange} range The range to get toolbar state for.
|
|
1531
|
+
* @return {string?} The selection block state.
|
|
1532
|
+
* @private
|
|
1533
|
+
*/
|
|
1534
|
+
goog.editor.plugins.BasicTextFormatter.getSelectionBlockState_ =
|
|
1535
|
+
function(range) {
|
|
1536
|
+
var tagName = null;
|
|
1537
|
+
goog.iter.forEach(range, function(node, ignore, it) {
|
|
1538
|
+
if (!it.isEndTag()) {
|
|
1539
|
+
// Iterate over all containers in the range, checking if they all have the
|
|
1540
|
+
// same tagName.
|
|
1541
|
+
var container = goog.editor.style.getContainer(node);
|
|
1542
|
+
var thisTagName = container.tagName;
|
|
1543
|
+
tagName = tagName || thisTagName;
|
|
1544
|
+
|
|
1545
|
+
if (tagName != thisTagName) {
|
|
1546
|
+
// If we find a container tag that doesn't match, exit right away.
|
|
1547
|
+
tagName = null;
|
|
1548
|
+
throw goog.iter.StopIteration;
|
|
1549
|
+
}
|
|
1550
|
+
|
|
1551
|
+
// Skip the tag.
|
|
1552
|
+
it.skipTag();
|
|
1553
|
+
}
|
|
1554
|
+
});
|
|
1555
|
+
|
|
1556
|
+
return tagName;
|
|
1557
|
+
};
|
|
1558
|
+
|
|
1559
|
+
|
|
1560
|
+
/**
|
|
1561
|
+
* Hash of suppoted justifications.
|
|
1562
|
+
* @type {Object}
|
|
1563
|
+
* @private
|
|
1564
|
+
*/
|
|
1565
|
+
goog.editor.plugins.BasicTextFormatter.SUPPORTED_JUSTIFICATIONS_ = {
|
|
1566
|
+
'center': 1,
|
|
1567
|
+
'justify': 1,
|
|
1568
|
+
'right': 1,
|
|
1569
|
+
'left': 1
|
|
1570
|
+
};
|
|
1571
|
+
|
|
1572
|
+
|
|
1573
|
+
/**
|
|
1574
|
+
* Returns true if the current justification matches the justification
|
|
1575
|
+
* command for the entire selection.
|
|
1576
|
+
* @param {string} command The justification command to check for.
|
|
1577
|
+
* @return {boolean} Whether the current justification matches the justification
|
|
1578
|
+
* command for the entire selection.
|
|
1579
|
+
* @private
|
|
1580
|
+
*/
|
|
1581
|
+
goog.editor.plugins.BasicTextFormatter.prototype.isJustification_ =
|
|
1582
|
+
function(command) {
|
|
1583
|
+
var alignment = command.replace('+justify', '').toLowerCase();
|
|
1584
|
+
if (alignment == 'full') {
|
|
1585
|
+
alignment = 'justify';
|
|
1586
|
+
}
|
|
1587
|
+
var bidiPlugin = this.fieldObject.getPluginByClassId('Bidi');
|
|
1588
|
+
if (bidiPlugin) {
|
|
1589
|
+
// BiDi aware version
|
|
1590
|
+
|
|
1591
|
+
// TODO: Since getComputedStyle is not used here, this version may be even
|
|
1592
|
+
// faster. If profiling confirms that it would be good to use this approach
|
|
1593
|
+
// in both cases. Otherwise the bidi part should be moved into an
|
|
1594
|
+
// execCommand so this bidi plugin dependence isn't needed here.
|
|
1595
|
+
/** @type {Function} */
|
|
1596
|
+
bidiPlugin.getSelectionAlignment;
|
|
1597
|
+
return alignment == bidiPlugin.getSelectionAlignment();
|
|
1598
|
+
} else {
|
|
1599
|
+
// BiDi unaware version
|
|
1600
|
+
var range = this.getRange_();
|
|
1601
|
+
if (!range) {
|
|
1602
|
+
// When nothing is in the selection then no justification
|
|
1603
|
+
// command matches.
|
|
1604
|
+
return false;
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
var parent = range.getContainerElement();
|
|
1608
|
+
var nodes =
|
|
1609
|
+
goog.array.filter(
|
|
1610
|
+
parent.childNodes,
|
|
1611
|
+
function(node) {
|
|
1612
|
+
return goog.editor.node.isImportant(node) &&
|
|
1613
|
+
range.containsNode(node, true);
|
|
1614
|
+
});
|
|
1615
|
+
nodes = nodes.length ? nodes : [parent];
|
|
1616
|
+
|
|
1617
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
1618
|
+
var current = nodes[i];
|
|
1619
|
+
|
|
1620
|
+
// If any node in the selection is not aligned the way we are checking,
|
|
1621
|
+
// then the justification command does not match.
|
|
1622
|
+
var container = goog.editor.style.getContainer(
|
|
1623
|
+
/** @type {Node} */ (current));
|
|
1624
|
+
if (alignment !=
|
|
1625
|
+
goog.editor.plugins.BasicTextFormatter.getNodeJustification_(
|
|
1626
|
+
container)) {
|
|
1627
|
+
return false;
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
// If all nodes in the selection are aligned the way we are checking,
|
|
1632
|
+
// the justification command does match.
|
|
1633
|
+
return true;
|
|
1634
|
+
}
|
|
1635
|
+
};
|
|
1636
|
+
|
|
1637
|
+
|
|
1638
|
+
/**
|
|
1639
|
+
* Determines the justification for a given block-level element.
|
|
1640
|
+
* @param {Element} element The node to get justification for.
|
|
1641
|
+
* @return {string} The justification for a given block-level node.
|
|
1642
|
+
* @private
|
|
1643
|
+
*/
|
|
1644
|
+
goog.editor.plugins.BasicTextFormatter.getNodeJustification_ =
|
|
1645
|
+
function(element) {
|
|
1646
|
+
var value = goog.style.getComputedTextAlign(element);
|
|
1647
|
+
// Strip preceding -moz- or -webkit- (@bug 2472589).
|
|
1648
|
+
value = value.replace(/^-(moz|webkit)-/, '');
|
|
1649
|
+
|
|
1650
|
+
// If there is no alignment, try the inline property,
|
|
1651
|
+
// otherwise assume left aligned.
|
|
1652
|
+
// TODO: for rtl languages we probably need to assume right.
|
|
1653
|
+
if (!goog.editor.plugins.BasicTextFormatter.
|
|
1654
|
+
SUPPORTED_JUSTIFICATIONS_[value]) {
|
|
1655
|
+
value = element.align || 'left';
|
|
1656
|
+
}
|
|
1657
|
+
return /** @type {string} */ (value);
|
|
1658
|
+
};
|
|
1659
|
+
|
|
1660
|
+
|
|
1661
|
+
/**
|
|
1662
|
+
* Returns true if a selection contained in the node should set the appropriate
|
|
1663
|
+
* toolbar state for the given nodeName, e.g. if the node is contained in a
|
|
1664
|
+
* strong element and nodeName is "strong", then it will return true.
|
|
1665
|
+
* @param {string} nodeName The type of node to check for.
|
|
1666
|
+
* @return {boolean} Whether the user's selection is in the given state.
|
|
1667
|
+
* @private
|
|
1668
|
+
*/
|
|
1669
|
+
goog.editor.plugins.BasicTextFormatter.prototype.isNodeInState_ =
|
|
1670
|
+
function(nodeName) {
|
|
1671
|
+
var range = this.getRange_();
|
|
1672
|
+
var node = range && range.getContainerElement();
|
|
1673
|
+
var ancestor = goog.dom.getAncestorByTagNameAndClass(node, nodeName);
|
|
1674
|
+
return !!ancestor && goog.editor.node.isEditable(ancestor);
|
|
1675
|
+
};
|
|
1676
|
+
|
|
1677
|
+
|
|
1678
|
+
/**
|
|
1679
|
+
* Wrapper for browser's queryCommandState.
|
|
1680
|
+
* @param {Document|TextRange|Range} queryObject The object to query.
|
|
1681
|
+
* @param {string} command The command to check.
|
|
1682
|
+
* @param {boolean=} opt_styleWithCss Set to true to enable styleWithCSS before
|
|
1683
|
+
* performing the queryCommandState.
|
|
1684
|
+
* @return {boolean} The command state.
|
|
1685
|
+
* @private
|
|
1686
|
+
*/
|
|
1687
|
+
goog.editor.plugins.BasicTextFormatter.prototype.queryCommandStateInternal_ =
|
|
1688
|
+
function(queryObject, command, opt_styleWithCss) {
|
|
1689
|
+
return /** @type {boolean} */ (this.queryCommandHelper_(true, queryObject,
|
|
1690
|
+
command, opt_styleWithCss));
|
|
1691
|
+
};
|
|
1692
|
+
|
|
1693
|
+
|
|
1694
|
+
/**
|
|
1695
|
+
* Wrapper for browser's queryCommandValue.
|
|
1696
|
+
* @param {Document|TextRange|Range} queryObject The object to query.
|
|
1697
|
+
* @param {string} command The command to check.
|
|
1698
|
+
* @param {boolean=} opt_styleWithCss Set to true to enable styleWithCSS before
|
|
1699
|
+
* performing the queryCommandValue.
|
|
1700
|
+
* @return {string|boolean|null} The command value.
|
|
1701
|
+
* @private
|
|
1702
|
+
*/
|
|
1703
|
+
goog.editor.plugins.BasicTextFormatter.prototype.queryCommandValueInternal_ =
|
|
1704
|
+
function(queryObject, command, opt_styleWithCss) {
|
|
1705
|
+
return this.queryCommandHelper_(false, queryObject,
|
|
1706
|
+
command, opt_styleWithCss);
|
|
1707
|
+
};
|
|
1708
|
+
|
|
1709
|
+
|
|
1710
|
+
/**
|
|
1711
|
+
* Helper function to perform queryCommand(Value|State).
|
|
1712
|
+
* @param {boolean} isGetQueryCommandState True to use queryCommandState, false
|
|
1713
|
+
* to use queryCommandValue.
|
|
1714
|
+
* @param {Document|TextRange|Range} queryObject The object to query.
|
|
1715
|
+
* @param {string} command The command to check.
|
|
1716
|
+
* @param {boolean=} opt_styleWithCss Set to true to enable styleWithCSS before
|
|
1717
|
+
* performing the queryCommand(Value|State).
|
|
1718
|
+
* @return {string|boolean|null} The command value.
|
|
1719
|
+
* @private
|
|
1720
|
+
*/
|
|
1721
|
+
goog.editor.plugins.BasicTextFormatter.prototype.queryCommandHelper_ = function(
|
|
1722
|
+
isGetQueryCommandState, queryObject, command, opt_styleWithCss) {
|
|
1723
|
+
command =
|
|
1724
|
+
goog.editor.plugins.BasicTextFormatter.convertToRealExecCommand_(
|
|
1725
|
+
command);
|
|
1726
|
+
if (opt_styleWithCss) {
|
|
1727
|
+
var doc = this.getDocument_();
|
|
1728
|
+
// Don't use this.execCommandHelper_ here, as it is more heavyweight
|
|
1729
|
+
// and inserts a dummy div to protect against comamnds that could step
|
|
1730
|
+
// outside the editable region, which would cause change event on
|
|
1731
|
+
// every toolbar update.
|
|
1732
|
+
doc.execCommand('styleWithCSS', false, true);
|
|
1733
|
+
}
|
|
1734
|
+
var ret = isGetQueryCommandState ? queryObject.queryCommandState(command) :
|
|
1735
|
+
queryObject.queryCommandValue(command);
|
|
1736
|
+
if (opt_styleWithCss) {
|
|
1737
|
+
doc.execCommand('styleWithCSS', false, false);
|
|
1738
|
+
}
|
|
1739
|
+
return ret;
|
|
1740
|
+
};
|