sproutcore 1.5.0 → 1.6.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.mailmap +32 -0
- data/CHANGELOG +8 -1
- data/Rakefile +16 -0
- data/VERSION.yml +2 -2
- data/bin/sc-build +0 -5
- data/bin/sc-build-number +0 -5
- data/bin/sc-docs +0 -5
- data/bin/sc-gen +0 -5
- data/bin/sc-init +0 -5
- data/bin/sc-manifest +0 -5
- data/bin/sc-server +0 -5
- data/bin/sproutcore +0 -5
- data/lib/frameworks/sproutcore/Buildfile +3 -3
- data/lib/frameworks/sproutcore/CHANGELOG.md +13 -0
- data/lib/frameworks/sproutcore/README.md +77 -7
- data/lib/frameworks/sproutcore/frameworks/ajax/system/request.js +0 -2
- data/lib/frameworks/sproutcore/frameworks/animation/core.js +3 -2
- data/lib/frameworks/sproutcore/frameworks/bootstrap/system/browser.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/array.js +1 -17
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/controller.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/object.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/handlebars/collection.js +23 -21
- data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/delegate_support.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/device.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +16 -16
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/platform.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/render_context.js +1 -34
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/root_responder.js +29 -23
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/sparse_array.js +8 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/string.js +20 -23
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/sparse_array.js +55 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/collection.js +49 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/handlebars.js +19 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template_collection.js +2 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/animation.js +4 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout.js +1 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view.js +38 -41
- data/lib/frameworks/sproutcore/frameworks/datastore/system/query.js +7 -82
- data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +12 -5
- data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/array_observers.js +82 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/flush.js +17 -0
- data/lib/frameworks/sproutcore/frameworks/debug/core.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/debug/invoke_once_last_debugging.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/core.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/slider.css +33 -30
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/border.js +12 -11
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_fast_path.js +7 -7
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_row_delegate.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_view_delegate.js +20 -20
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/navigation_builder.js +5 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/scrollable.js +10 -10
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/alert.js +24 -23
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/menu.js +51 -54
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/modal.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/panel.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/select_button.js +29 -29
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drag_source.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drop_target.js +6 -6
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/responder.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/checkbox.js +5 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/master_detail.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/progress.js +5 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/radio.js +7 -7
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/radio_group.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/slider.js +7 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/system/drag.js +31 -31
- data/lib/frameworks/sproutcore/frameworks/desktop/system/undo_manager.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/button.js +35 -29
- data/lib/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +61 -50
- data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +9 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/views/select.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/views/select_field.js +6 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/static_content.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/experimental/Buildfile +2 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/coders/object.js +12 -12
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/controllers/designs.js +6 -6
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/controllers/page_files.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/css/css_style_sheet.js +7 -9
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/designers/object_designer.js +13 -13
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/designers/view_designer.js +37 -37
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/ext/object.js +3 -2
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/ext/page.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/ext/view.js +4 -3
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/mixins/snap_lines.js +7 -6
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/views/designer_drop_target.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/views/drawing.js +49 -42
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/views/high_light.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/views/page_item_view.js +6 -6
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/device_motion/device.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/english.lproj/default_styles.css +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/english.lproj/strings.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/mixins/edit_mode.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/mixins/emptiness.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/render_delegates/form.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/render_delegates/form_row.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/tests/views/form.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/tests/views/form_checkbox_field.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/tests/views/form_field.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/tests/views/form_label.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/tests/views/form_radio_field.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/tests/views/form_row.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/tests/views/form_text_field.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/views/form.js +13 -14
- data/lib/frameworks/sproutcore/frameworks/{forms → experimental/frameworks/forms}/views/form_row.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/models/record.js +4 -6
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/static_layout.js +0 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/private/tree_item_observer.js +2 -4
- data/lib/frameworks/sproutcore/frameworks/foundation/system/image_queue.js +8 -12
- data/lib/frameworks/sproutcore/frameworks/foundation/views/inline_text_field.js +28 -34
- data/lib/frameworks/sproutcore/frameworks/{foundation → routing}/system/routes.js +31 -47
- data/lib/frameworks/sproutcore/frameworks/{foundation → routing}/tests/system/routes.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/core.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/base.js +15 -21
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/array.js +8 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/array_observers.js +23 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/contains.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/intersects.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/statechart/system/state.js +66 -133
- data/lib/frameworks/sproutcore/frameworks/statechart/system/statechart.js +68 -139
- data/lib/frameworks/sproutcore/frameworks/testing/system/plan.js +11 -11
- data/lib/frameworks/sproutcore/frameworks/testing/system/suite.js +23 -29
- data/lib/frameworks/sproutcore/lib/index.rhtml +5 -2
- data/lib/sproutcore/builders/minify.rb +5 -5
- data/lib/sproutcore/helpers/minifier.rb +6 -10
- data/lib/sproutcore/models/target.rb +2 -2
- data/lib/sproutcore/rack/proxy.rb +8 -7
- data/lib/sproutcore/tools.rb +16 -5
- data/lib/sproutcore.rb +2 -9
- data/spec/lib/builders/html_spec.rb +5 -5
- data/sproutcore.gemspec +11 -5
- data/vendor/chance/lib/chance.rb +4 -2
- data/{lib/sproutcore/vendor → vendor}/jsdoc/README.txt +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/Chain.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/Dumper.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/Hash.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/Link.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/Namespace.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/Opt.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/Reflection.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/String.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame/Testrun.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/frame.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/handlers/FOODOC.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/handlers/XMLDOC/DomReader.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/handlers/XMLDOC/XMLDoc.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/handlers/XMLDOC/XMLParse.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/handlers/XMLDOC.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/DocComment.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/DocTag.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/JsDoc.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/JsPlate.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/Lang.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/Parser.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/PluginManager.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/Symbol.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/SymbolSet.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/TextStream.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/Token.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/TokenReader.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/TokenStream.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/Util.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC/Walker.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/lib/JSDOC.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/main.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/plugins/commentSrcJson.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/plugins/frameworkPrototype.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/plugins/functionCall.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/plugins/publishSrcHilite.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/plugins/sproutcoreTags.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/plugins/symbolLink.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/plugins/tagParamConfig.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/plugins/tagSynonyms.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/run.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/t/TestDoc.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/t/runner.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/addon.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/anon_inner.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/augments.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/augments2.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/borrows.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/borrows2.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/config.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/constructs.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/encoding.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/encoding_other.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/functions_anon.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/functions_nested.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/global.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/globals.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/ignore.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/inner.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/jsdoc_test.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/lend.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/memberof.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/memberof_constructor.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/name.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/namespace_nested.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/nocode.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/oblit_anon.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/overview.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/param_inline.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/params_optional.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/prototype.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/prototype_nested.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/prototype_oblit.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/prototype_oblit_constructor.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/public.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/shared.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/shared2.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/shortcuts.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/static_this.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/synonyms.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/tosource.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test/variable_redefine.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/app/test.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/changes.txt +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/conf/sample.conf +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/java/build.xml +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/java/build_1.4.xml +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/java/classes/js.jar +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/java/src/JsDebugRun.java +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/java/src/JsRun.java +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/jsdebug.jar +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/jsrun.jar +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/t/TestDoc.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/t/runner.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/addon.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/anon_inner.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/augments.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/augments2.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/borrows.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/borrows2.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/config.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/constructs.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/encoding.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/encoding_other.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/functions_anon.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/functions_nested.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/global.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/globals.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/ignore.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/inner.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/jsdoc_test.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/lend.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/memberof.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/memberof_constructor.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/name.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/namespace_nested.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/nocode.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/oblit_anon.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/overview.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/param_inline.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/params_optional.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/prototype.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/prototype_nested.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/prototype_oblit.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/prototype_oblit_constructor.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/public.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/shared.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/shared2.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/shortcuts.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/static_this.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/synonyms.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/tosource.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test/variable_redefine.js +0 -0
- data/{lib/sproutcore/vendor → vendor}/jsdoc/test.js +0 -0
- data/vendor/sproutcore/{src/SCCompiler/lib/yuicompressor-2.4.4.jar → lib/yuicompressor-2.4.6.jar} +0 -0
- metadata +176 -202
- data/lib/frameworks/sproutcore/frameworks/desktop/views/file.js +0 -148
- data/lib/sproutcore/vendor/github_gem_lint.rb +0 -22
- data/vendor/sproutcore/SCCompiler.jar +0 -0
- data/vendor/sproutcore/lib/args4j-2.0.12.jar +0 -0
- data/vendor/sproutcore/lib/yuicompressor-2.4.2.jar +0 -0
- data/vendor/sproutcore/src/SCCompiler/build.xml +0 -74
- data/vendor/sproutcore/src/SCCompiler/lib/args4j-2.0.12.jar +0 -0
- data/vendor/sproutcore/src/SCCompiler/lib/htmlcompressor-0.9.3.jar +0 -0
- data/vendor/sproutcore/src/SCCompiler/lib/yuicompressor-2.4.2.jar +0 -0
- data/vendor/sproutcore/src/SCCompiler/manifest.mf +0 -3
- data/vendor/sproutcore/src/SCCompiler/nbproject/build-impl.xml +0 -894
- data/vendor/sproutcore/src/SCCompiler/nbproject/genfiles.properties +0 -8
- data/vendor/sproutcore/src/SCCompiler/nbproject/private/config.properties +0 -0
- data/vendor/sproutcore/src/SCCompiler/nbproject/private/private.properties +0 -10
- data/vendor/sproutcore/src/SCCompiler/nbproject/private/private.xml +0 -4
- data/vendor/sproutcore/src/SCCompiler/nbproject/project.properties +0 -90
- data/vendor/sproutcore/src/SCCompiler/nbproject/project.xml +0 -15
- data/vendor/sproutcore/src/SCCompiler/src/com/sproutcore/Main.java +0 -348
@@ -1,8 +0,0 @@
|
|
1
|
-
build.xml.data.CRC32=cd68bf06
|
2
|
-
build.xml.script.CRC32=75d8d7ed
|
3
|
-
build.xml.stylesheet.CRC32=28e38971@1.38.3.45
|
4
|
-
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
5
|
-
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
6
|
-
nbproject/build-impl.xml.data.CRC32=cd68bf06
|
7
|
-
nbproject/build-impl.xml.script.CRC32=dfd1072c
|
8
|
-
nbproject/build-impl.xml.stylesheet.CRC32=229523de@1.38.3.45
|
File without changes
|
@@ -1,10 +0,0 @@
|
|
1
|
-
application.args=\ /Users/juanpin/Desktop/stylesheet-packed.css
|
2
|
-
compile.on.save=true
|
3
|
-
do.depend=true
|
4
|
-
do.jar=true
|
5
|
-
file.reference.args4j-2.0.12.jar=/Users/juanpin/NetBeansProjects/SCCompiler/lib/args4j-2.0.12.jar
|
6
|
-
file.reference.htmlcompressor-0.9.3.jar=/Users/juanpin/NetBeansProjects/SCCompiler/lib/htmlcompressor-0.9.3.jar
|
7
|
-
file.reference.yuicompressor-2.4.2.jar=/Users/juanpin/NetBeansProjects/SCCompiler/lib/yuicompressor-2.4.2.jar
|
8
|
-
javac.debug=true
|
9
|
-
javadoc.preview=true
|
10
|
-
user.properties.file=/Users/juanpin/.netbeans/6.9/build.properties
|
@@ -1,90 +0,0 @@
|
|
1
|
-
annotation.processing.enabled=true
|
2
|
-
annotation.processing.enabled.in.editor=false
|
3
|
-
annotation.processing.run.all.processors=true
|
4
|
-
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
|
5
|
-
application.desc=Minifies css, js and html using YUI Compressor\n and HTMLcompressor (http://code.google.com/p/htmlcompressor/)
|
6
|
-
application.title=SCCompiler
|
7
|
-
application.vendor=SproutCore (Juan Pinzon)
|
8
|
-
build.classes.dir=${build.dir}/classes
|
9
|
-
build.classes.excludes=**/*.java,**/*.form
|
10
|
-
# This directory is removed when the project is cleaned:
|
11
|
-
build.dir=build
|
12
|
-
build.generated.dir=${build.dir}/generated
|
13
|
-
build.generated.sources.dir=${build.dir}/generated-sources
|
14
|
-
# Only compile against the classpath explicitly listed here:
|
15
|
-
build.sysclasspath=ignore
|
16
|
-
build.test.classes.dir=${build.dir}/test/classes
|
17
|
-
build.test.results.dir=${build.dir}/test/results
|
18
|
-
# Uncomment to specify the preferred debugger connection transport:
|
19
|
-
#debug.transport=dt_socket
|
20
|
-
debug.classpath=\
|
21
|
-
${run.classpath}
|
22
|
-
debug.test.classpath=\
|
23
|
-
${run.test.classpath}
|
24
|
-
# This directory is removed when the project is cleaned:
|
25
|
-
dist.dir=dist
|
26
|
-
dist.jar=${dist.dir}/SCCompiler.jar
|
27
|
-
dist.javadoc.dir=${dist.dir}/javadoc
|
28
|
-
endorsed.classpath=
|
29
|
-
excludes=
|
30
|
-
file.reference.args4j-2.0.12.jar=lib/args4j-2.0.12.jar
|
31
|
-
file.reference.htmlcompressor-0.9.3.jar=lib/htmlcompressor-0.9.3.jar
|
32
|
-
file.reference.yuicompressor-2.4.2.jar=lib/yuicompressor-2.4.2.jar
|
33
|
-
includes=**
|
34
|
-
jar.archive.disabled=${jnlp.enabled}
|
35
|
-
jar.compress=true
|
36
|
-
jar.index=${jnlp.enabled}
|
37
|
-
javac.classpath=\
|
38
|
-
${file.reference.htmlcompressor-0.9.3.jar}:\
|
39
|
-
${file.reference.yuicompressor-2.4.2.jar}:\
|
40
|
-
${file.reference.args4j-2.0.12.jar}
|
41
|
-
# Space-separated list of extra javac options
|
42
|
-
javac.compilerargs=-Xlint:unchecked
|
43
|
-
javac.deprecation=false
|
44
|
-
javac.processorpath=\
|
45
|
-
${javac.classpath}
|
46
|
-
javac.source=1.6
|
47
|
-
javac.target=1.6
|
48
|
-
javac.test.classpath=\
|
49
|
-
${javac.classpath}:\
|
50
|
-
${build.classes.dir}:\
|
51
|
-
${libs.junit.classpath}:\
|
52
|
-
${libs.junit_4.classpath}
|
53
|
-
javac.test.processorpath=\
|
54
|
-
${javac.test.classpath}
|
55
|
-
javadoc.additionalparam=
|
56
|
-
javadoc.author=false
|
57
|
-
javadoc.encoding=${source.encoding}
|
58
|
-
javadoc.noindex=false
|
59
|
-
javadoc.nonavbar=false
|
60
|
-
javadoc.notree=false
|
61
|
-
javadoc.private=false
|
62
|
-
javadoc.splitindex=true
|
63
|
-
javadoc.use=true
|
64
|
-
javadoc.version=false
|
65
|
-
javadoc.windowtitle=
|
66
|
-
jnlp.codebase.type=no.codebase
|
67
|
-
jnlp.descriptor=application
|
68
|
-
jnlp.enabled=false
|
69
|
-
jnlp.mixed.code=defaut
|
70
|
-
jnlp.offline-allowed=false
|
71
|
-
jnlp.signed=false
|
72
|
-
main.class=com.sproutcore.Main
|
73
|
-
manifest.file=manifest.mf
|
74
|
-
meta.inf.dir=${src.dir}/META-INF
|
75
|
-
no.dependencies=true
|
76
|
-
platform.active=default_platform
|
77
|
-
run.classpath=\
|
78
|
-
${javac.classpath}:\
|
79
|
-
${build.classes.dir}:\
|
80
|
-
${file.reference.htmlcompressor-0.9.3.jar}
|
81
|
-
# Space-separated list of JVM arguments used when running the project
|
82
|
-
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
|
83
|
-
# or test-sys-prop.name=value to set system properties for unit tests):
|
84
|
-
run.jvmargs=
|
85
|
-
run.test.classpath=\
|
86
|
-
${javac.test.classpath}:\
|
87
|
-
${build.test.classes.dir}
|
88
|
-
source.encoding=UTF-8
|
89
|
-
src.dir=src
|
90
|
-
test.src.dir=test
|
@@ -1,15 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<project xmlns="http://www.netbeans.org/ns/project/1">
|
3
|
-
<type>org.netbeans.modules.java.j2seproject</type>
|
4
|
-
<configuration>
|
5
|
-
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
|
6
|
-
<name>SCCompiler</name>
|
7
|
-
<source-roots>
|
8
|
-
<root id="src.dir"/>
|
9
|
-
</source-roots>
|
10
|
-
<test-roots>
|
11
|
-
<root id="test.src.dir"/>
|
12
|
-
</test-roots>
|
13
|
-
</data>
|
14
|
-
</configuration>
|
15
|
-
</project>
|
@@ -1,348 +0,0 @@
|
|
1
|
-
package com.sproutcore;
|
2
|
-
|
3
|
-
import static org.kohsuke.args4j.ExampleMode.ALL;
|
4
|
-
import org.kohsuke.args4j.Argument;
|
5
|
-
import org.kohsuke.args4j.CmdLineException;
|
6
|
-
import org.kohsuke.args4j.CmdLineParser;
|
7
|
-
import org.kohsuke.args4j.Option;
|
8
|
-
|
9
|
-
import java.util.ArrayList;
|
10
|
-
import java.util.List;
|
11
|
-
import java.io.File;
|
12
|
-
import java.io.IOException;
|
13
|
-
import java.io.FileReader;
|
14
|
-
import java.io.FileWriter;
|
15
|
-
|
16
|
-
//import com.google.common.collect.ImmutableList;
|
17
|
-
//import com.google.javascript.jscomp.CheckLevel;
|
18
|
-
//import com.google.javascript.jscomp.ClosureCodingConvention;
|
19
|
-
//import com.google.javascript.jscomp.CompilationLevel;
|
20
|
-
//import com.google.javascript.jscomp.Compiler;
|
21
|
-
//import com.google.javascript.jscomp.CompilerOptions;
|
22
|
-
//import com.google.javascript.jscomp.JSSourceFile;
|
23
|
-
//import com.google.javascript.jscomp.Result;
|
24
|
-
//import com.google.javascript.jscomp.CommandLineRunner;
|
25
|
-
//import com.google.javascript.jscomp.DiagnosticGroups;
|
26
|
-
//
|
27
|
-
import com.googlecode.htmlcompressor.DefaultErrorReporter;
|
28
|
-
import com.googlecode.htmlcompressor.compressor.HtmlCompressor;
|
29
|
-
|
30
|
-
import org.mozilla.javascript.ErrorReporter;
|
31
|
-
import org.mozilla.javascript.EvaluatorException;
|
32
|
-
import com.yahoo.platform.yui.compressor.CssCompressor;
|
33
|
-
import com.yahoo.platform.yui.compressor.JavaScriptCompressor;
|
34
|
-
import java.io.BufferedReader;
|
35
|
-
import java.util.logging.Level;
|
36
|
-
|
37
|
-
public class Main {
|
38
|
-
|
39
|
-
@Option(name = "-adv", usage = "advanced mode")
|
40
|
-
private boolean advanced;
|
41
|
-
@Option(name = "-yuionly", usage = "Yui compressor only")
|
42
|
-
private boolean yuionly;
|
43
|
-
@Argument
|
44
|
-
private List<String> arguments = new ArrayList<String>();
|
45
|
-
|
46
|
-
public static void main(String[] args) throws IOException {
|
47
|
-
new Main().doMain(args);
|
48
|
-
}
|
49
|
-
|
50
|
-
/**
|
51
|
-
* Compiles the code using the specified configuration.
|
52
|
-
* @param file JavaScript source code to compile.
|
53
|
-
* @param level The compilation level to use when compiling the code.
|
54
|
-
* @param boolean prettyPrint True to pretty-print the compiled code.
|
55
|
-
* @param externs to use when compiling the code.
|
56
|
-
* @return The compiled version of the code.
|
57
|
-
* @throws CmdLineException if compilation is unsuccessful.
|
58
|
-
*/
|
59
|
-
// public static String compile(File file, CompilationLevel level,
|
60
|
-
// boolean prettyPrint, List<JSSourceFile> externs) throws Exception {
|
61
|
-
// // A new Compiler object should be created for each compilation because
|
62
|
-
// // using a previous Compiler will retain state from a previous compilation.
|
63
|
-
// Compiler compiler = new Compiler();
|
64
|
-
// CompilerOptions options = new CompilerOptions();
|
65
|
-
// // setOptionsForCompilationLevel() configures the appropriate options on the
|
66
|
-
// // CompilerOptions object.
|
67
|
-
//
|
68
|
-
// level.setOptionsForCompilationLevel(options);
|
69
|
-
// // Options can also be configured by modifying the Options object directly.
|
70
|
-
// options.prettyPrint = prettyPrint;
|
71
|
-
//
|
72
|
-
//
|
73
|
-
// // This is an important setting that the Closure Compiler Application uses
|
74
|
-
// // to ensure that its type checking logic uses the type annotations used by
|
75
|
-
// // Closure.
|
76
|
-
// options.setWarningLevel(DiagnosticGroups.ACCESS_CONTROLS, CheckLevel.OFF);
|
77
|
-
// options.setWarningLevel(DiagnosticGroups.AMBIGUOUS_FUNCTION_DECL, CheckLevel.OFF);
|
78
|
-
// options.setWarningLevel(DiagnosticGroups.CHECK_REGEXP, CheckLevel.OFF);
|
79
|
-
// options.setWarningLevel(DiagnosticGroups.CHECK_TYPES, CheckLevel.OFF);
|
80
|
-
// options.setWarningLevel(DiagnosticGroups.CHECK_VARIABLES, CheckLevel.OFF);
|
81
|
-
// options.setWarningLevel(DiagnosticGroups.DEPRECATED, CheckLevel.OFF);
|
82
|
-
// options.setWarningLevel(DiagnosticGroups.EXTERNS_VALIDATION, CheckLevel.OFF);
|
83
|
-
// options.setWarningLevel(DiagnosticGroups.FILEOVERVIEW_JSDOC, CheckLevel.OFF);
|
84
|
-
// options.setWarningLevel(DiagnosticGroups.INVALID_CASTS, CheckLevel.OFF);
|
85
|
-
// options.setWarningLevel(DiagnosticGroups.MISSING_PROPERTIES, CheckLevel.OFF);
|
86
|
-
// options.setWarningLevel(DiagnosticGroups.NON_STANDARD_JSDOC, CheckLevel.OFF);
|
87
|
-
// options.setWarningLevel(DiagnosticGroups.STRICT_MODULE_DEP_CHECK, CheckLevel.OFF);
|
88
|
-
// options.setWarningLevel(DiagnosticGroups.UNDEFINED_VARIABLES, CheckLevel.OFF);
|
89
|
-
// options.setWarningLevel(DiagnosticGroups.UNKNOWN_DEFINES, CheckLevel.OFF);
|
90
|
-
// options.setWarningLevel(DiagnosticGroups.VISIBILITY, CheckLevel.OFF);
|
91
|
-
//
|
92
|
-
// options.setCodingConvention(new ClosureCodingConvention());
|
93
|
-
//
|
94
|
-
// // Input to the compiler must be associated with a JSSourceFile object.
|
95
|
-
// // The dummy input name "input.js" is used here so that any warnings or
|
96
|
-
// // errors will cite line numbers in terms of input.js.
|
97
|
-
// JSSourceFile input = JSSourceFile.fromFile(file);
|
98
|
-
// List<JSSourceFile> inputs = ImmutableList.of(input);
|
99
|
-
// // compile() returns a Result that contains the warnings and errors.
|
100
|
-
// compiler.setLoggingLevel(Level.WARNING);
|
101
|
-
// Result result = compiler.compile(externs, inputs, options);
|
102
|
-
// if (result.success) {
|
103
|
-
// // The Compiler is responsible for generating the compiled code; the
|
104
|
-
// // compiled code is not accessible via the Result.
|
105
|
-
// return compiler.toSource();
|
106
|
-
// } else {
|
107
|
-
// // If compilation was unsuccessful, throw an exception. It is up to the
|
108
|
-
// // client to read the errors and warnings out of the exception to display
|
109
|
-
// // them.
|
110
|
-
// System.err.println(result.debugLog);
|
111
|
-
// throw new Exception("Closure couldn't minify. Check errors");
|
112
|
-
// }
|
113
|
-
// }
|
114
|
-
|
115
|
-
public void doMain(String[] args) throws IOException {
|
116
|
-
CmdLineParser parser = new CmdLineParser(this);
|
117
|
-
ArrayList v = new ArrayList();
|
118
|
-
ArrayList types = new ArrayList();
|
119
|
-
ArrayList<File> fileArray = new ArrayList<File>();
|
120
|
-
int i = 0, size = 0;
|
121
|
-
String type = null, inputFilename, compiledCode;
|
122
|
-
File f;
|
123
|
-
FileReader in = null;
|
124
|
-
FileWriter out = null;
|
125
|
-
// List<JSSourceFile> externs = CommandLineRunner.getDefaultExterns();
|
126
|
-
|
127
|
-
System.out.println("Starting minification...");
|
128
|
-
try {
|
129
|
-
// parse the arguments.
|
130
|
-
parser.parseArgument(args);
|
131
|
-
|
132
|
-
// you can parse additional arguments if you want.
|
133
|
-
// parser.parseArgument("more","args");
|
134
|
-
|
135
|
-
// after parsing arguments, you should check
|
136
|
-
// if enough arguments are given.
|
137
|
-
|
138
|
-
if (arguments.isEmpty()) {
|
139
|
-
throw new CmdLineException("No argument is given");
|
140
|
-
} else {
|
141
|
-
if (advanced) {
|
142
|
-
System.out.println("-adv flag is set");
|
143
|
-
}
|
144
|
-
|
145
|
-
if (yuionly) {
|
146
|
-
System.out.println("-yuionly flag is set");
|
147
|
-
}
|
148
|
-
|
149
|
-
|
150
|
-
// access non-option arguments
|
151
|
-
|
152
|
-
for (i = 0; i < arguments.size(); i++) {
|
153
|
-
inputFilename = arguments.get(i);
|
154
|
-
f = new File(inputFilename);
|
155
|
-
|
156
|
-
visitAllDirsAndFiles(f, fileArray);
|
157
|
-
}
|
158
|
-
}
|
159
|
-
|
160
|
-
for (i = 0; i < fileArray.size(); i++) {
|
161
|
-
f = (File) fileArray.get(i);
|
162
|
-
System.out.println(f.getAbsolutePath());
|
163
|
-
// if (f.getName().toLowerCase().endsWith(".js") && !yuionly) {
|
164
|
-
// compiledCode = compile(
|
165
|
-
// f,
|
166
|
-
// advanced ? CompilationLevel.ADVANCED_OPTIMIZATIONS
|
167
|
-
// : CompilationLevel.SIMPLE_OPTIMIZATIONS,
|
168
|
-
// false,// do not prettyPrint the output
|
169
|
-
// externs);
|
170
|
-
// System.out.println("_____________________________________________");
|
171
|
-
// System.out.println("--- Minifying JS using Closure... " + f.getAbsolutePath());
|
172
|
-
// out = new FileWriter(f);
|
173
|
-
// out.write(compiledCode);
|
174
|
-
// out.close();
|
175
|
-
// } else
|
176
|
-
if (f.getName().toLowerCase().endsWith(".js")/* && yuionly*/) {
|
177
|
-
System.out.println("_____________________________________________");
|
178
|
-
System.out.println("--- Minifying JS using YUICompressor... " + f.getAbsolutePath());
|
179
|
-
try {
|
180
|
-
|
181
|
-
in = new FileReader(f);
|
182
|
-
|
183
|
-
JavaScriptCompressor compressor = new JavaScriptCompressor(in, new ErrorReporter() {
|
184
|
-
|
185
|
-
public void warning(String message, String sourceName,
|
186
|
-
int line, String lineSource, int lineOffset) {
|
187
|
-
if (line < 0) {
|
188
|
-
System.err.println("\n[WARNING] " + message);
|
189
|
-
} else {
|
190
|
-
System.err.println("\n[WARNING] " + line + ':' + lineOffset + ':' + message);
|
191
|
-
}
|
192
|
-
}
|
193
|
-
|
194
|
-
public void error(String message, String sourceName,
|
195
|
-
int line, String lineSource, int lineOffset) {
|
196
|
-
if (line < 0) {
|
197
|
-
System.err.println("\n[ERROR] " + message);
|
198
|
-
} else {
|
199
|
-
System.err.println("\n[ERROR] " + line + ':' + lineOffset + ':' + message);
|
200
|
-
}
|
201
|
-
}
|
202
|
-
|
203
|
-
public EvaluatorException runtimeError(String message, String sourceName,
|
204
|
-
int line, String lineSource, int lineOffset) {
|
205
|
-
error(message, sourceName, line, lineSource, lineOffset);
|
206
|
-
return new EvaluatorException(message);
|
207
|
-
}
|
208
|
-
});
|
209
|
-
|
210
|
-
// Close the input stream first, and then open the output stream,
|
211
|
-
// in case the output file should override the input file.
|
212
|
-
in.close();
|
213
|
-
in = null;
|
214
|
-
|
215
|
-
out = new FileWriter(f);
|
216
|
-
|
217
|
-
boolean munge = false;
|
218
|
-
boolean preserveAllSemiColons = false;
|
219
|
-
boolean disableOptimizations = false;
|
220
|
-
int linebreakpos = 80;
|
221
|
-
boolean verbose = false;
|
222
|
-
|
223
|
-
compressor.compress(out, linebreakpos, munge, verbose,
|
224
|
-
preserveAllSemiColons, disableOptimizations);
|
225
|
-
out.close();
|
226
|
-
|
227
|
-
} catch (EvaluatorException e) {
|
228
|
-
|
229
|
-
System.out.println("failed minifying... " + e);
|
230
|
-
// Return a special error code used specifically by the web front-end.
|
231
|
-
System.exit(2);
|
232
|
-
|
233
|
-
}
|
234
|
-
|
235
|
-
} else if (f.getName().toLowerCase().endsWith(".css")) { //css
|
236
|
-
in = new FileReader(f);
|
237
|
-
System.out.println("_____________________________________________");
|
238
|
-
System.err.println("--- Minifying CSS: " + f.getAbsolutePath());
|
239
|
-
CssCompressor cssCompressor=null;
|
240
|
-
try{
|
241
|
-
cssCompressor = new CssCompressor(in);
|
242
|
-
}catch (Exception exp){
|
243
|
-
exp.printStackTrace();
|
244
|
-
}
|
245
|
-
// Close the input stream first, and then open the output stream,
|
246
|
-
// in case the output file should override the input file.
|
247
|
-
in.close();
|
248
|
-
in = null;
|
249
|
-
|
250
|
-
out = new FileWriter(f);
|
251
|
-
|
252
|
-
cssCompressor.compress(out, 0);
|
253
|
-
out.close();
|
254
|
-
} else {
|
255
|
-
StringBuilder contents = new StringBuilder();
|
256
|
-
|
257
|
-
try {
|
258
|
-
//use buffering, reading one line at a time
|
259
|
-
//FileReader always assumes default encoding is OK!
|
260
|
-
BufferedReader input = new BufferedReader(new FileReader(f));
|
261
|
-
try {
|
262
|
-
String line = null;
|
263
|
-
while ((line = input.readLine()) != null) {
|
264
|
-
contents.append(line);
|
265
|
-
contents.append(System.getProperty("line.separator"));
|
266
|
-
}
|
267
|
-
} finally {
|
268
|
-
input.close();
|
269
|
-
}
|
270
|
-
} catch (IOException ex) {
|
271
|
-
System.out.println("exception");
|
272
|
-
ex.printStackTrace();
|
273
|
-
}
|
274
|
-
|
275
|
-
System.out.println("_____________________________________________");
|
276
|
-
System.err.println("--- Minifying HTML: " + f.getAbsolutePath());
|
277
|
-
HtmlCompressor htmlCompressor = new HtmlCompressor();
|
278
|
-
|
279
|
-
htmlCompressor.setEnabled(true); //if false all compression is off (default is true)
|
280
|
-
htmlCompressor.setRemoveComments(false); //if false keeps HTML comments (default is true)
|
281
|
-
htmlCompressor.setRemoveMultiSpaces(true); //if false keeps multiple whitespace characters (default is true)
|
282
|
-
htmlCompressor.setRemoveIntertagSpaces(true); //removes iter-tag whitespace characters
|
283
|
-
htmlCompressor.setRemoveQuotes(false); //removes unnecessary tag attribute quotes
|
284
|
-
htmlCompressor.setCompressCss(true); //compress css using Yahoo YUI Compressor
|
285
|
-
htmlCompressor.setCompressJavaScript(true); //compress js using Yahoo YUI Compressor
|
286
|
-
htmlCompressor.setYuiCssLineBreak(80); //--line-break param for Yahoo YUI Compressor
|
287
|
-
htmlCompressor.setYuiJsDisableOptimizations(false); //--disable-optimizations param for Yahoo YUI Compressor
|
288
|
-
htmlCompressor.setYuiJsLineBreak(80); //--line-break param for Yahoo YUI Compressor
|
289
|
-
htmlCompressor.setYuiJsNoMunge(true); //--nomunge param for Yahoo YUI Compressor
|
290
|
-
htmlCompressor.setYuiJsPreserveAllSemiColons(false);//--preserve-semi param for Yahoo YUI Compressor
|
291
|
-
|
292
|
-
/* Sets default error reporting for YUI compressor that uses System.err.
|
293
|
-
If no error reporter is provided, a null pointer exception
|
294
|
-
will be thrown in case of an error during JavaScript compression.
|
295
|
-
This is needed only if JavaScript compression is enabled */
|
296
|
-
htmlCompressor.setYuiErrorReporter(new DefaultErrorReporter());
|
297
|
-
String compressedHtml = htmlCompressor.compress(contents.toString());
|
298
|
-
out = new FileWriter(f);
|
299
|
-
out.write(compressedHtml);
|
300
|
-
out.close();
|
301
|
-
|
302
|
-
}
|
303
|
-
}
|
304
|
-
|
305
|
-
} catch (CmdLineException e) {
|
306
|
-
// if there's a problem in the command line,
|
307
|
-
// you'll get this exception. this will report
|
308
|
-
// an error message.
|
309
|
-
System.err.println(e.getMessage());
|
310
|
-
System.err.println("java -jar SCCompiler.jar [options...] arguments...");
|
311
|
-
// print the list of available options
|
312
|
-
parser.printUsage(System.err);
|
313
|
-
System.err.println();
|
314
|
-
|
315
|
-
// print option sample. This is useful some time
|
316
|
-
System.err.println(" Example: java -jar SCCompiler.jar" + parser.printExample(ALL));
|
317
|
-
return;
|
318
|
-
} catch (Exception ex) {
|
319
|
-
System.out.println("exception");
|
320
|
-
ex.printStackTrace();
|
321
|
-
}
|
322
|
-
// this will redirect the output to the specified output
|
323
|
-
//System.out.println(out);
|
324
|
-
}
|
325
|
-
|
326
|
-
public static void visitAllDirsAndFiles(File dir, ArrayList<File> files) {
|
327
|
-
if (dir.isDirectory()) {
|
328
|
-
String[] children = dir.list();
|
329
|
-
for (int i = 0; i < children.length; i++) {
|
330
|
-
visitAllDirsAndFiles(new File(dir, children[i]), files);
|
331
|
-
}
|
332
|
-
} else {
|
333
|
-
try {
|
334
|
-
if (dir.getName().toLowerCase().endsWith(".js")) {
|
335
|
-
files.add(dir);
|
336
|
-
} else if (dir.getName().toLowerCase().endsWith(".css")) {
|
337
|
-
files.add(dir);
|
338
|
-
} else if (dir.getName().toLowerCase().endsWith(".html")) {
|
339
|
-
files.add(dir);
|
340
|
-
}
|
341
|
-
} catch (Exception e) {
|
342
|
-
System.err.println(e);
|
343
|
-
}
|
344
|
-
|
345
|
-
}
|
346
|
-
return;
|
347
|
-
}
|
348
|
-
}
|