Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Commit

Permalink
#138 add properties to load js and css files as binary
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Kim committed Sep 28, 2013
1 parent 45c59ec commit 569f82a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
8 changes: 8 additions & 0 deletions deploy/default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ qconsole-port=8000
#
load-html-as-xml=true

#
# If true, .js and .css files under the src directory will be loaded as binary.
# If false, they will be loaded using the MarkLogic default behavior, which is
# to treat them as text.
#
load-js-as-binary=true
load-css-as-binary=true

#
# The ports used by your application
#
Expand Down
6 changes: 5 additions & 1 deletion deploy/lib/server_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,8 @@ def deploy_modules
app_config_file = File.join xquery_dir, "/app/config/config.xqy"
test_config_file = File.join test_dir, "/test-config.xqy"
load_html_as_xml = @properties['ml.load-html-as-xml']
load_js_as_binary = @properties['ml.load-js-as-binary']
load_css_as_binary = @properties['ml.load-css-as-binary']

modules_databases.each do |dest_db|
ignore_us = []
Expand All @@ -830,7 +832,9 @@ def deploy_modules
:remove_prefix => xquery_dir,
:db => dest_db,
:ignore_list => ignore_us,
:load_html_as_xml => load_html_as_xml
:load_html_as_xml => load_html_as_xml,
:load_js_as_binary => load_js_as_binary,
:load_css_as_binary => load_css_as_binary

if File.exist? app_config_file
buffer = File.read app_config_file
Expand Down
2 changes: 2 additions & 0 deletions deploy/lib/xcc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ def build_load_uri(target_uri, options, commit)
url << "&format=xml" if options[:load_html_as_xml] == "true" && target_uri[/\.html$/]
url << "&format=xml" if options[:format] == "xml"
url << "&format=text" if options[:format] == "text"
url << "&format=binary" if options[:load_js_as_binary] == "true" && target_uri[/\.js$/]
url << "&format=binary" if options[:load_css_as_binary] == "true" && target_uri[/\.css$/]
url << "&format=binary" if options[:format] == "binary"

options[:forests].each do |forest|
Expand Down

0 comments on commit 569f82a

Please sign in to comment.