Example #1
0
def test_single_bundle():
    """Test registering a single ``Bundle`` object.
    """

    b = Bundle()
    register('foo', b)
    assert _get() == b
Example #2
0
    def register(self):
        if not self.name or not self.path:
            raise CompositeBundleError("both 'name' and 'path' must be filled")

        bundles_css, bundles_js = self.get_merged_bundles()

        if bundles_css:
            register(self.name_css, *bundles_css, output="%s/css/%s.css" % (self.path, self.name))

        if bundles_js:
            register(self.name_js, *bundles_js, output="%s/js/%s.js" % (self.path, self.name))
Example #3
0
def test_duplicate():
    """Test name clashes.
    """

    b1 = Bundle()
    b2 = Bundle()

    register('foo', b1)

    # Multiple calls with the same name are ignored if the given bundle
    # is the same as originally passed.
    register('foo', b1)
    assert len(_REGISTRY) == 1

    # Otherwise, an error is raised.
    assert_raises(RegistryError, register, 'foo', b2)
    assert_raises(RegistryError, register, 'foo', 's1', 's2', 's3')
Example #4
0
def test_new_bundle():
    """Test registering a new bundle on the fly.
    """

    b = Bundle()
    register('foo', b, 's2', 's3')
    assert b in _get('foo').contents

    # Special case of using only a single, non-bundle source argument.
    register('footon', 's1')
    assert 's1' in _get('footon').contents

    # Special case of specifying only a single bundle as a source, but
    # additional options - this also creates a wrapping bundle.
    register('foofighters', b, output="bar")
    assert b in _get('foofighters').contents
Example #5
0
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.

from django_assets import Bundle, register


# <Webpack>
# These are handled by webpack and therefore have no filters applied
# They're kept here so hash-based cache invalidation can be used

js_vendor = Bundle(
    'js/vendor.bundle.js',
    output='js/vendor.min.%(version)s.js')
register('js_vendor', js_vendor)

js_common = Bundle(
    'js/common/app.bundle.js',
    output='js/common/app.min.%(version)s.js')
register('js_common', js_common)

js_admin_general_app = Bundle(
    'js/admin/general/app.bundle.js',
    output='js/admin/general/app.min.%(version)s.js')
register('js_admin_general_app', js_admin_general_app)

js_admin_app = Bundle(
    'js/admin/app.bundle.js',
    output='js/admin/app.min.%(version)s.js')
register('js_admin_app', js_admin_app)
Example #6
0
#pylint: disable=invalid-name

# All the CSS we need for the entire site. This tradeoff between
# bandwidth and latency is good as long as we have a high and consistent
# utilization of all the CSS tags for all pages on the site.
css_base = Bundle('cache/_base.css',
                  'vendor/font-awesome.css',
                  'vendor/nv.d3.css',
                  'vendor/c3.css',
                  'vendor/trip.css',
                  'vendor/bootstrap-toggle.css',
                  'css/matrix-chart.css',
                  filters=[],
                  output='cache/envconnect.css')
register('css_base', css_base)

css_email = Bundle('cache/_email.css',
                   filters=['cssmin'],
                   output='cache/email.css',
                   debug=False)
register('css_email', css_email)

# Minimal: jquery and bootstrap always active on the site
js_base = Bundle('vendor/jquery.js',
                 'vendor/popper-utils.js',
                 'vendor/popper.js',
                 'vendor/bootstrap.js',
                 'vendor/bootbox.js',
                 'vendor/jquery.selection.js',
                 'vendor/trip.js',
Example #7
0
from django_assets import Bundle, register

tableCss = Bundle('css/wordwalls/wordwallsTableSS.css',
                  filters='cssmin',
                  output='css/wordwalls/packedWWT.css')

register('css_table', tableCss)
Example #8
0
minify_bundle = Bundle('../static/js/angular/angular.min.js')

plugins_bundle = Bundle('../static/js/jquery/datepicker.js',
                        '../static/js/jquery/jquery.asmselect.js',
                        '../static/js/jquery/jquery.tabslideout-1.3.js',
                        '../static/js/jquery/jquery.popupwindow.js',
                        '../static/js/jquery/jquery.formset.js',
                        '../static/js/angular/ui-bootstrap-tpls-0.4.0.js')

app_bundle = Bundle('../static/js/bulk_actions.js',
                    '../static/js/languages.js',
                    '../static/js/multiselect.js',
                    '../static/js/toggler.js',
                    '../static/js/tabslideout.js',
                    '../static/js/combobox.js',
                    '../static/js/bootstrap.js')


js = Bundle(base_bundle, minify_bundle, plugins_bundle, app_bundle, filters='yui_js', output='bundle.min.js')

register('js', js)

css = Bundle('../static/css/bootstrap.css',
            '../static/css/bootstrap-responsive.css',
            '../static/css/jquery.asmselect.css',
            '../static/css/jquery-ui.css',
            '../static/css/jquery.asmselect.css',
            '../static/css/style.css', filters='yui_css', output='bundle.min.css')

register('css', css)
Example #9
0
# coding=utf-8
# Copyright 2014 Janusz Skonieczny

from pathlib import PosixPath

from django_assets import Bundle, register

assets_css = PosixPath('assets') / 'css'
assets_js = PosixPath('assets') / 'js'

CSS = (
    assets_css / "bootstrap4.css",
    assets_css / "font-awesome4.css",
    assets_css / "screen.css",
)

JS = (
    assets_js / "jquery.min.js",
    assets_js / "bootstrap.js",
    assets_js / "main.js",
)

JS = [str(f) for f in JS]
CSS = [str(f) for f in CSS]

register('js', Bundle(*JS, filters='yui_js', output='script.%(version)s.js'))
register('css', Bundle(*CSS, filters='yui_css',
                       output='style.%(version)s.css'))
Example #10
0
from django_assets import Bundle, register


MANAGEMENT_JS_ASSETS = (
    'js/jquery.dataTables.min.js',
    'js/jquery.customDataTable.js',
    'js/main.js',
)


MANAGEMENT_CSS_ASSETS = (
	'css/formalize.css',
    'css/bootstrap.grid.css',
    'css/eionet-ui.css',
    'css/jquery.dataTables.css'
)


management_js = Bundle(*MANAGEMENT_JS_ASSETS, filters='jsmin',
                       output='management_packed.js')
management_css = Bundle(*MANAGEMENT_CSS_ASSETS, filters='cssmin',
                        output='management_packed.css')

register('management_js', management_js)
register('management_css', management_css)
Example #11
0
from django.conf import settings

from django_assets import Bundle, register


if getattr(settings, 'ASSETS_VERSIONS', True):
    postfix = '-%(version)s'
else:
    postfix = ''


css = Bundle(
    'sass/bootstrap-include.sass',
    filters=['compass'],
    output='styles/bootstrap{}.css'.format(postfix),
)
register('bootstrap_css', css)


js = Bundle(
    'js/bootstrap-tooltip.js', 'js/bootstrap-*.js', 'js/bootstrap-popover.js',
    filters=[],
    output='scripts/bootstrap{}.js'.format(postfix),
)
register('bootstrap_js', js)
Example #12
0
from django_assets import Bundle, register

## CSS ##
# Base
css_base_bundle = Bundle('site_media/css/style.css',
						 'site_media/css/navigation.css',
						filters = 'yui_css', output = 'site_media/css/gen/packed.base.css')
register('css_base', css_base_bundle)

css_ie_fixes_bundle = Bundle('site_media/css/ie_fixes.css')
register('css_ie_fixes',
		css_ie_fixes_bundle,
		filters = 'yui_css', output = 'site_media/css/gen/packed.ie_fixes.css')

# Index
css_index_bundle = Bundle('site_media/css/index.css')
register('css_index',
		css_index_bundle,
		filters = 'yui_css', output = 'site_media/css/gen/packed.index.css')

## Javascript ##
# Jquery
js_jquery_bundle = Bundle('site_media/js/jquery-1.4.1.min.js',
						  'site_media/js/jquery.qtip-1.0.0-rc3.min.js',
						  'site_media/js/tooltips.js',
						  'site_media/js/hide_message.js')
register('js_jquery',
		js_jquery_bundle,
		filters = 'yui_js', output = 'site_media/js/gen/packed.jquery.js')

# IE6 reject
Example #13
0
from django_assets import register
from dukpy.webassets import CompileLess
from dukpy.webassets import BabelJS


register('awesomplete',
         'awesomplete/awesomplete.js',
         'kasse/awesomplete.js',
         filters='jsmin', output='gen/awesomplete.js')

register('stopwatch',
         'stopwatch/stopwatch.es6',
         'picturefill.js',
         filters=(BabelJS, 'jsmin'), output='gen/stopwatch.js')

register('kassestyle',
         'kasse/style.css',
         filters=CompileLess, output='gen/kasse.css')
Example #14
0
from django_assets import Bundle, register

# Compile sass files to css and squash
sass = Bundle('search/sass/main.scss',\
    'search/sass/index.scss',\
    'search/sass/flatpage.scss',\
    'search/sass/recruitment.scss',\
    filters='scss,cssmin')

css = Bundle(
    'search/css/bootstrap.css',\
    sass,\
    filters="cssmin", output="gen/packed.css")

# Pack js libraries
libs = Bundle('search/js/jquery.min.js',\
    'search/js/jquery.history.js',\
    'search/js/bootstrap.min.js',\
    'search/select2/select2.js',\
    output='gen/packed.js')

register('search_css', css)
register('search_js_libs', libs)
Example #15
0
from django_assets import Bundle, register


register('{{ app_name }}_css', Bundle(
    Bundle(
        "{{ app_name }}/styles/{{ app_name }}.scss",
        filters="pyscss",
    ),
    filters='cssrewrite,cssmin',
    output='_/{{ app_name }}.css'
))

register('{{ app_name }}_js', Bundle(
    Bundle(
        "{{ app_name }}/scripts/{{ app_name }}.coffee",
        filters='coffeescript,jsmin',
    ),
    Bundle(
        "{{ app_name }}/scripts/{{ app_name }}.js",
        filters='jsmin'
    ),
    output='_/{{ app_name }}.js'
))
Example #16
0
from django_assets import Bundle, register

main_css = Bundle('sass/_base.scss',
                  depends="sass/**/*.scss",
                  filters='scss, cssmin',
                  output='css/main.min.css')

home_css = Bundle('sass/trumps/home.scss',
                  filters='scss, cssmin',
                  output='css/projects/home.min.css')

grid_css = Bundle('sass/trumps/grid.scss',
                  filters='scss, cssmin',
                  output='css/projects/grid.min.css')

blog_css = Bundle('sass/trumps/blog.scss',
                  filters='scss, cssmin',
                  output='css/projects/blog.min.css')

calendar_css = Bundle('sass/trumps/calendar.scss',
                      filters='scss, cssmin',
                      output='css/projects/calendar.min.css')

register('main_css', main_css)
register('grid_css', grid_css)
register('home_css', home_css)
register('blog_css', blog_css)
register('calendar_css', calendar_css)
Example #17
0
from django_assets import Bundle, register

js = Bundle('edge/src/js/*.js', filters='jsmin', output='edge/static/edge/edge.min.js')
register('edge_js', js)

js = Bundle('edge/src/js/*.js', output='edge/static/edge/edge.js')
register('edge', js)

css = Bundle('edge/src/css/app.css', output='edge/static/edge/edge.css')
register('edge_css', css)

jst = Bundle('edge/src/partials/*.html', filters='jst', output='edge/static/edge/edge_jst.js')
register('edge_jst', jst)
Example #18
0
CSS_ASSETS = (
    'css/bootstrap.min.css',
    'css/bootstrap-datetimepicker.css',
    'css/jquery.dataTables.css',
    'css/select2/select2.css',
    'css/select2/select2-bootstrap.css',
    'css/style.css',
)

HOMEPAGE_CSS_ASSETS = ('css/home.css', )

JS_ASSETS = (
    'js/lib/jquery.min.js',
    'js/lib/bootstrap.min.js',
    'js/lib/moment.js',
    'js/lib/bootstrap-datetimepicker.min.js',
    'js/lib/jquery.dataTables.min.js',
    'js/lib/select2.min.js',
    'js/main.js',
)

css = Bundle(*CSS_ASSETS, filters='cssmin', output='packed.css')
home_css = Bundle(*HOMEPAGE_CSS_ASSETS,
                  filters='cssmin',
                  output='homepacked.css')
js = Bundle(*JS_ASSETS, filters='jsmin', output='packed.js')
register('css', css)
register('home_css', home_css)
register('js', js)
Example #19
0
    "js/jquery/jquery.easing.js",
    "js/jquery/jquery.serializeObject.js",
    "js/jquery/jquery.select2.js",
    "js/bootstrap/bootstrap-alert.js",
    "js/bootstrap/bootstrap-transition.js",
    "js/common.js",
    "js/search.js",
    "js/sorttable.js",
    "js/spin.js",
    "js/utils.js",
    "js/zoom.js",
    "js/shortcut.js",  # Leave shortcut.js as the last one
    filters="rjsmin",
    output="js/common.min.js",
)
register("js_common", js_common)

js_admin = Bundle("js/admin.js", filters="rjsmin", output="js/admin.min.js")
register("js_admin", js_admin)

js_editor = Bundle(
    "js/jquery/jquery.history.js",
    "js/jquery/jquery.tmpl.js",
    "js/jquery/jquery.textarea-expander.js",
    "js/diff_match_patch.js",
    "js/jquery/jquery.fieldselection.js",
    "js/jquery/jquery.caret.js",
    "js/jquery/jquery.highlightRegex.js",
    "js/jquery/jquery.jsonp.js",
    "js/iso8601.js",
    "js/editor.js",
Example #20
0
register('all_js',
        Bundle(
            'js/vendor/lodash.compat.min.js',
            'js/vendor/backbone-min.js',
            'js/vendor/ractive.js',
            'js/vendor/ractive-adaptors-backbone.js',
            'js/vendor/ractive-transitions-slide.js',
            'js/vendor/ractive-events-tap.js',
            'js/vendor/bootstrap.min.js',
            'js/vendor/jasny-bootstrap.js',
            'js/vendor/moment-with-locales.min.js',
            'js/vendor/jquery.browser.min.js',
            'js/vendor/jquery.growfield2.js',
            'js/vendor/jquery.nanoscroller.min.js',
            'js/vendor/spin.min.js',
            'js/vendor/jquery.cookie.js',
            'js/vendor/jquery.spin.js',
            'js/vendor/bootstrap-datetimepicker.min.js',

            'js/app.js',
            'js/utils.js',

            'js/invoice.js',
            'js/invoicelist.js',
            'js/task.js',
            'js/profiles.js',
            'js/actions.js',
            'js/filters.js',

            'js/router.js',
        ),
        filters='jsmin',
        output='cache/packed.js')
Example #21
0
from django_assets import Bundle, register

# Assets for the landing pages
css_landing = Bundle('bootstrap/dist/css/bootstrap.css',
                     'css/landing-page.css',
                     filters=(
                         'cssrewrite',
                         'yui_css',
                     ),
                     output='compiled-assets/gen/css_landing.%(version)s.css')

register('css_landing', css_landing)

js_landing = Bundle('jquery/dist/jquery.js',
                    'bootstrap/dist/js/bootstrap.js',
                    filters='closure_js',
                    output='compiled-assets/gen/js_landing.%(version)s.js')

register('js_landing', js_landing)

# Assets for the application
css_main = Bundle('bootstrap/dist/css/bootstrap.css',
                  'djng/css/styles.css',
                  'font-awesome/css/font-awesome.css',
                  'css/datasets.css',
                  filters=(
                      'cssrewrite',
                      'yui_css',
                  ),
                  output='compiled-assets/gen/css_main.%(version)s.css')
Example #22
0
            'main/js/models/Element.js',
            'main/js/models/Schema.js',
            'main/js/models/Occurrence.js',
            'main/js/models/Shapes.js',
            'main/js/models/Followers.js',
            'main/js/models/Groups.js',
            'main/js/models/HopeUser.js',
            'main/js/controllers/ProjectsController.js',
            'main/js/controllers/UsersController.js',
            'main/js/views/FindReports/MapHandler.js',
            'main/js/views/FindReports/GmapHandler.js',
            'main/js/views/FindReports/FindReportsView.js',
            'main/js/views/Reports/DrawingHandler.js',
            'main/js/views/Reports/ReportView.js',
            'main/js/views/Reports/ReportFormView.js',
            'main/js/views/Profile/ProfileView.js',
            'main/js/views/Manage/ManageView.js',
            'main/js/views/DecisionSupport/DecisionView.js',
            'main/js/views/Reports/TOcMapView.js',
            'main/js/views/Groups/GroupsView.js',
            'main/js/common.js',
            'main/js/application.js',
            filters='jsmin', output='gen/packed.js')

register('js_all', js)
register('css_all', css)

# dev
register('css_dev', cssdev)
register('js_dev', jsdev)
Example #23
0
# -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from django_assets import Bundle, register

test_main_css = Bundle(
    'css/jquery-ui.min.css',
    'css/base.css',
    filters='cssmin',
    output='css/test_main_css.css'
)
register('test_main_all_css', test_main_css)

test_main_js = Bundle(
    'js/jquery-1.11.1.min.js',
    'js/jquery-ui.min.js',
    'js/base.js',
    filters='jsmin',
    output='js/test_main_js.js'
)
register('test_main_all_js', test_main_js)
Example #24
0
from django_assets import Bundle, register

JS_ASSETS = (
    'js/jquery-1.7.1.min.js',
    'js/jquery-ui-1.10.3.custom.min.js',
    'js/jquery.uniform.js',
    'js/chosen.jquery.js',
    'bootstrap/js/bootstrap.js',
)

CSS_ASSETS = (
    'bootstrap/css/bootstrap.css',
    'bootstrap/css/bootstrap-responsive.css',
    'css/uniform.default.css',
    'css/chosen.css',
    'css/style.css',
)

js = Bundle(*JS_ASSETS, filters='jsmin', output='gen/packed.js')
css = Bundle(*CSS_ASSETS, filters='cssmin', output='gen/packed.css')

register('js', js)
register('css', css)
Example #25
0
    # 'js/calendar.min.js',
    'js/feeds.min.js',
    # 'js/toggler.min.js',
    # 'js/functions.js',
    filters="jsmin",
    output="dist/base.js")

core_js = Bundle('js/jquery.min.js',
                 "js/bootstrap.min.js",
                 filters="jsmin",
                 output="dist/core.js")

base_css = Bundle('css/bootstrap.min.css',
                  'css/animate.min.css',
                  'css/font-awesome.min.css',
                  'css/form.css',
                  'css/calendar.css',
                  'css/style.css',
                  'css/icons.css',
                  'css/generics.css',
                  'scss/restaurant.css',
                  filters="cssmin",
                  output="dist/base.css")

# javascript
register("base-js", base_js)
register("core-js", core_js)

# styles
register("basecss", base_css)
Example #26
0
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.

from django_assets import Bundle, register

js_common = Bundle('js/jquery/jquery.js',
                   'js/jquery/jquery.tipsy.js',
                   'js/jquery/jquery.cookie.js',
                   'js/jquery/jquery.bidi.js',
                   'js/jquery/jquery.fancybox.js',
                   'js/common.js',
                   'js/sorttable.js',
                   'js/shortcut.js',
                   filters='rjsmin',
                   output='js/common.min.js')
register('js_common', js_common)

js_admin = Bundle('js/jquery/jquery.form.js',
                  'js/admin.js',
                  filters='rjsmin',
                  output='js/admin.min.js')
register('js_admin', js_admin)

js_editor = Bundle('js/jquery/jquery.easing.js',
                   'js/jquery/jquery.history.js',
                   'js/jquery/jquery.tmpl.js',
                   'js/jquery/jquery.textarea-expander.js',
                   'js/diff_match_patch.js',
                   'js/editor.js',
                   'js/json2.js',
                   'js/jquery/jquery.fieldselection.js',
Example #27
0
    'bootstrap/css/bootstrap.css',
    'bootstrap/css/bootstrap-responsive.css',
    'css/bootstrap-ui/jquery-ui-1.8.16.custom.css',
    'css/bootstrap-ui/jquery.ui.1.8.16.ie.css',
    'css/uniform.default.css',
    'css/chosen.css',
) + settings.CSS_ASSETS

IE8_CSS_ASSETS = (
    'css/ie8.css',
)

IE9_CSS_ASSETS = (
    'css/ie9.css',
)


js = Bundle(*JS_ASSETS, filters='jsmin', output='gen/packed.js')
js_admin = Bundle(*JS_ADMIN_ASSETS, filters='jsmin', output='gen/admin_packed.js')

css = Bundle(*CSS_ASSETS, filters='cssmin', output='gen/packed.css')
ie8_css = Bundle(*IE8_CSS_ASSETS)
ie9_css = Bundle(*IE9_CSS_ASSETS)

register('js', js)
register('js_admin', js_admin)
register('css', css)
register('ie8_css', ie8_css)
register('ie9_css', ie9_css)

Example #28
0
from django_assets import Bundle, register

lib_js = Bundle('libs/jquery-1.8.2.min.js',
                'libs/jquery.easing.1.3.js',
                'libs/underscore.js',
                'js/console.js',
                output='_compress/js/lib.js')

register('lib_js', lib_js)

fresco_js = Bundle('plugins/fresco/fresco.js',
                   output='_compress/lightbox/js/lightbox.js')

fresco_css = Bundle('plugins/fresco/fresco.css',
                    filters='cssrewrite',
                    output='_compress/lightbox/css/lightbox.css')

register('fresco_js', fresco_js)

register('fresco_css', fresco_css)

# register('main_js', Bundle(
#     'js/jquery.min.js',
#     'js/slick.min.js',
#     'plugins/pace/pace.min.js',
#     'js/main.js',
#     output='_compress/js/main.js'))
#
# register('mobile_main_js', Bundle(
#     'mobile/js/jquery.min.js',
#     'mobile/js/slick.min.js',
Example #29
0
        './css/lib/bootstrap.css',
        './css/lib/typeahead.css',
        './css/lib/colorbox.css',
        './css/lib/rateit.css',
        './css/fonts.css',
        './colorbox/example1/colorbox.css',
    ),
    Bundle(
        './css/site_v2.styl',
        './css/site-xs_v2.styl',
        filters='stylus',
        output='./css/site_v2.css'
    ),
    filters='cssmin',
    output='./css/packed_v2.%(version)s.css',
)

language_ar = Bundle(
    Bundle(
        './css/language_ar.styl',
        filters='stylus',
        output='./css/language_ar.css'
    ),
    filters='cssmin',
    output='./css/packed_language_ar.%(version)s.css',
)

register('js_all', js)
register('css_all_v2', css_v2)
register('css_language_ar', language_ar)
Example #30
0
thirdparty_path = os.path.join(settings.BASE_DIR, "node_modules")
sass = get_filter("scss",
                  style="compressed",
                  load_paths=("./css", thirdparty_path))

uglify_args = ["--comments", "/^!/", "-m", "-c"]
uglify = get_filter("uglifyjs",
                    binary=os.path.join(thirdparty_path, ".bin", "uglifyjs"),
                    extra_args=uglify_args)

css = Bundle(
    "css/inboxen.scss",
    filters=(sass, ),
    output="compiled/css/website.%(version)s.css",
)
register("inboxen_css", css)

js = Bundle(
    "thirdparty/jquery/dist/jquery.js",
    "js/utils.js",
    "js/copy.js",
    "js/alert.js",
    "js/home.js",
    "js/search.js",
    "js/inbox.js",
    filters=(uglify, ),
    output="compiled/js/website.%(version)s.js",
)
register("inboxen_js", js)

chart_js = Bundle(
Example #31
0
from django_assets import Bundle, register

## CSS ##
css_partners_bundle = Bundle('site_media/css/partners.css')
register('css_partners',
		css_partners_bundle,
		filters = 'yui_css', output = 'site_media/css/gen/packed.partners.css')

## Javascript ##
Example #32
0
#Javascript
register('all_js',
        Bundle(
            #'js/foundation/foundation.js',
            #'js/foundation/foundation.abide.js',
            #'js/foundation/foundation.accordion.js',
            #'js/foundation/foundation.alert.js',
            #'js/foundation/foundation.clearing.js',
            #'js/foundation/foundation.dropdown.js',
            #'js/foundation/foundation.equalizer.js',
            #'js/foundation/foundation.interchange.js',
            #'js/foundation/foundation.joyride.js',
            #'js/foundation/foundation.magellan.js',
            #'js/foundation/foundation.offcanvas.js',
            #'js/foundation/foundation.orbit.js',
            #'js/foundation/foundation.reveal.js',
            #'js/foundation/foundation.slider.js',
            #'js/foundation/foundation.tab.js',
            #'js/foundation/foundation.tooltip.js',
            #'js/foundation/foundation.topbar.js',

            'js/foundation.min.js',
            'js/jquery.cookie.js',
            'js/jquery-ajax-validation.js',
            'js/app.js',
        ),
        filters='jsmin',
        output='cache/packed.js')

#Scss
Example #33
0
from django_assets import Bundle, register

# Compile sass files to css and squash
sass = Bundle("simulator/sass/main.scss", filters="scss,cssmin", output="gen/sim.css")

register("sim_css", sass)
Example #34
0
                 'js/interface.js',
                 filters="yui_js",
                 output="js/dist/base.js")

students_manager_js = Bundle("js/helpers.js",
                             "bower_components/lodash/lodash.min.js",
                             "bower_components/angular/angular.js",
                             "bower_components/angular-route/angular-route.js",
                             "bower_components/angular-animate/angular-animate.js",
                             "js/students/manager/app.js",
                             "js/students/manager/controllers/group.js",
                             "js/students/manager/controllers/groups.js",
                             "js/students/manager/controllers/years.js",
                             "js/students/manager/models/_base.js",
                             "js/students/manager/models/student.js",
                             "js/students/manager/models/group.js",
                             filters="jsmin",
                             output="js/students/manager/dist/app.js")

main_css = Bundle('lib/bootstrap/bootstrap.min.css',
                  'bower_components/qtip2/jquery.qtip.min.css',
                  'bower_components/pickmeup/css/pickmeup.min.css',
                  'bower_components/fontawesome-iconpicker/dist/css/fontawesome-iconpicker.css',
                  'css/style.css',
                  filters="cssmin",
                  output="css/main.min.css")

register("base-js", base_js)
register("students_manager_js", students_manager_js)
register("main_css", main_css)
Example #35
0
from django_assets import Bundle, register

# =============================================================================
# Announcement forms
# =============================================================================

announcement_forms_css = Bundle('announce/styles/announce.css',
                                'js/datetimepicker/datepicker.css',
                                filters='cssutils',
                                output='announce/styles/forms_packed.css')
register('announcement_forms_css', announcement_forms_css)

announcement_forms_js = Bundle('js/datetimepicker/Locale.en-US.DatePicker.js',
                               'js/datetimepicker/Picker.js',
                               'js/datetimepicker/Picker.Attach.js',
                               'js/datetimepicker/Picker.Date.js',
                               'js/loadingOverlay.js',
                               filters='jsmin',
                               output='announce/scripts/forms_packed.js')
register('announcement_forms_js', announcement_forms_js)
Example #36
0
from django_assets import Bundle, register

flashcardJs = Bundle('js/whitleyCards/quiz.js',
                     filters='jsmin',
                     output='js/whitleyCards/packedFlashcards.js')

register('js_quiz', flashcardJs)
Example #37
0
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.

from django_assets import Bundle, register


# <Webpack>
# These are handled by webpack and therefore have no filters applied
# They're kept here so hash-based cache invalidation can be used

js_vendor = Bundle(
    'js/vendor.bundle.js',
    output='js/vendor.min.%(version)s.js')
register('js_vendor', js_vendor)

js_common = Bundle(
    'js/common/app.bundle.js',
    output='js/common/app.min.%(version)s.js')
register('js_common', js_common)

js_admin_general_app = Bundle(
    'js/admin/general/app.bundle.js',
    output='js/admin/general/app.min.%(version)s.js')
register('js_admin_general_app', js_admin_general_app)

js_admin_app = Bundle(
    'js/admin/app.bundle.js',
    output='js/admin/app.min.%(version)s.js')
register('js_admin_app', js_admin_app)
Example #38
0
from django.conf import settings

#pylint: disable=invalid-name

# All the CSS we need for the entire app. This tradeoff between
# bandwidth and latency is good as long as we have a high and consistent
# utilization of all the CSS tags for all pages on the site.
css_base = Bundle(Bundle(os.path.join(settings.BASE_DIR,
                                      'assets/less/base/tcapp-bootstrap.less'),
                         filters='less',
                         output='cache/bootstrap.css',
                         debug=False),
                  'vendor/font-awesome.css',
                  filters='cssmin',
                  output='cache/teacapp.css')
register('css_base', css_base)

css_email = Bundle(os.path.join(settings.BASE_DIR,
                                'assets/less/email/email.less'),
                   filters=['less', 'cssmin'],
                   output='cache/email.css',
                   debug=False)
register('css_email', css_email)

# Minimal, jquery always active on the site
js_base = Bundle('vendor/jquery.js',
                 'vendor/bootstrap.js',
                 filters='yui_js',
                 output='cache/base.js')
register('js_base', js_base)
from django_assets import Bundle, register
js = Bundle(
    "third_party/rest_framework_docs/js/dist.min.js",
    output="packed/drf.js",
)
register('drf_js', js)

css = Bundle(
    "third_party/rest_framework_docs/css/style.css",
    output="packed/drf.css",
)
register('drf_css', css)
Example #40
0
from django_assets import Bundle, register

css = Bundle('eobase/scss/app.scss', filters='scss,cssmin', output='css/packed.css')

register('css_all', css)

js = Bundle(
    # 'eobase/static/bower_components/modernizr/modernizr.js',
    'bower_components/jquery/dist/jquery.js',
    # 'eobase/static/bower_components/toastr/toastr.js',
    'bower_components/bootstrap-sass/assets/javascripts/bootstrap/tooltip.js',
    'bower_components/bootstrap-sass/assets/javascripts/bootstrap/affix.js',
    'bower_components/bootstrap-sass/assets/javascripts/bootstrap/alert.js',
    'bower_components/bootstrap-sass/assets/javascripts/bootstrap/button.js',
    'bower_components/bootstrap-sass/assets/javascripts/bootstrap/carousel.js',
    'bower_components/bootstrap-sass/assets/javascripts/bootstrap/collapse.js',
    'bower_components/bootstrap-sass/assets/javascripts/bootstrap/dropdown.js',
    'bower_components/bootstrap-sass/assets/javascripts/bootstrap/modal.js',
    'bower_components/bootstrap-sass/assets/javascripts/bootstrap/popover.js',
    'bower_components/bootstrap-sass/assets/javascripts/bootstrap/scrollspy.js',
    'bower_components/bootstrap-sass/assets/javascripts/bootstrap/tab.js',
    'bower_components/bootstrap-sass/assets/javascripts/bootstrap/transition.js',
    'swampdragon/js/dist/swampdragon.min.js',
    'bower_components/jquery-pjax/jquery.pjax.js',
    'eobase/js/page_init.js',
    filters='uglifyjs', output='js/main.js')

register('js_all', js)
Example #41
0
from django_assets import Bundle, register

js_files = [
    'static/js/vendor/fancybox/jquery.fancybox.js',
]

js = Bundle(*js_files, filters='jsmin', output='static/js/bundle.js')

register('js_all', js)
Example #42
0
from django_assets import Bundle, register

# Main CSS

kashana_scss = Bundle('scss/kashana.scss',
                      filters='pyscss',
                      output='kashana/kashana.css',
                      depends='scss/**/*.scss')

pure_css = Bundle('css/pure.min.css')
pen_css = Bundle('css/pen.css')
ui_jq_css = Bundle('css/redmond/jquery-ui-1.11.4.custom.min.css')
jq_select_box_css = Bundle('css/select2/select2.min.css')

css_all = Bundle(pure_css,
                 pen_css,
                 ui_jq_css,
                 jq_select_box_css,
                 kashana_scss,
                 filters=['cssmin', 'cssrewrite'],
                 output='kashana/all.css')

admin_css = Bundle('scss/admin.scss',
                   filters=['pyscss', 'cssmin'],
                   output='kashana/admin.css',
                   depends='scss/**/*.scss')

register('css_all', css_all)
register('css_admin', admin_css)
Example #43
0
from django.conf import settings

from django_assets import Bundle, register
from webassets.filter import get_filter

libsass = get_filter("libsass", style="compressed")

css_libs = Bundle(settings.BASE_DIR + "/assets/styles/css/libs/normalize.css",
                  filters="cssutils",
                  output="css/libs.css")

css_custom = Bundle(
    settings.BASE_DIR + "/assets/styles/sass/base.sass",
    filters=libsass,
    output="css/style.css",
    depends="/**/*.sass",
)

register("css_libs", css_libs)
register("css_custom", css_custom)
Example #44
0
from django_assets import Bundle, register

js = Bundle('js/jquery-1.8.2.js',
            'js/bootstrap.js',
            filters='yui_js',
            output='../globalstatic/bundles/app.js')

css = Bundle('css/bootstrap.css',
             'css/bootstrap-responsive.css',
             output='../globalstatic/bundles/app.css')

register('js_app', js)
register('css_app', css)
Example #45
0
js_detail_organization = Bundle(
    "js/lib/auto-complete.js",
    "js/user/create_edit.js",
    "js/lib/gov_addresses.js",
    "js/user/autocomplete.js",
    filters="jsmin",
    output="js/user/detail_organization.min.js",
)
js_waypoints = Bundle("js/lib/jquery.waypoints.js",
                      filters="jsmin",
                      output="js/user/waypoints.min.js")
js_infinite = Bundle("js/lib/infinite.min.js",
                     filters="jsmin",
                     output="js/user/infinite.min.js")

register("css_custom_bootstrap", css_custom_bootstrap)
register("css_ateliersoude", css_atelier_soude)
register("css_places", css_places)
register("css_autocomplete", css_auto_complete)
register("css_detail_place", css_detail_place)
register("css_detail_event", css_detail_event)
register("css_detail_user", css_detail_user)
register("css_create_edit_event", css_create_edit_event)
register("css_detail_organization", css_detail_organization)

register("js_base", js_base)
register("js_places", js_places)
register("js_create_edit_place", js_create_edit_place)
register("js_create_edit_user", js_create_edit_user)
register("js_detail_place", js_detail_place)
register("js_detail_event", js_detail_event)
Example #46
0
from django_assets import Bundle, register
js_index = Bundle('blog/index_script.js', 'blog/paginate.js',
            filters='jsmin', output='gen/blog_index.js')
css_index = Bundle('blog/blog_style.css', 'blog/index_style.css', filters='cssmin', output='gen/blog_index.css')

js_post = Bundle('blog/paginate_pics.js', filters='jsmin', output='gen/blog_post.js')
css_post = Bundle('blog/blog_style.css', 'blog/post.css', filters='cssmin', output='gen/blog_post.css')

register('js_blog_index', js_index)
register('css_blog_index', css_index)

register('js_blog_post', js_post)
register('css_blog_post', css_post)
Example #47
0
"""
try:
    from django_assets import Bundle, register
except ImportError:
    DJANGO_ASSETS_INSTALLED = False
else:
    DJANGO_ASSETS_INSTALLED = True

if DJANGO_ASSETS_INSTALLED:
    from djangocodemirror import settings_local
    from djangocodemirror.config import ConfigManager

    # Build all Bundles from available editor settings
    for settings_name, settings_values in settings_local.CODEMIRROR_SETTINGS.items(
    ):
        config = ConfigManager(config_name=settings_name)

        css_options = settings_local.BUNDLES_CSS_OPTIONS.copy()
        css_options['output'] = css_options['output'].format(
            settings_name=settings_name)
        js_options = settings_local.BUNDLES_JS_OPTIONS.copy()
        js_options['output'] = js_options['output'].format(
            settings_name=settings_name)

        css_contents, js_contents = config.find_assets()

        register(config.settings['css_bundle_name'],
                 Bundle(*css_contents, **css_options))
        register(config.settings['js_bundle_name'],
                 Bundle(*js_contents, **js_options))
Example #48
0
                    "js/services/authsvc.js",
                    "js/services/dialogsvc.js",
                    "js/services/usersvc.js",
                    "js/services/oppsvc.js",
                    "js/services/searchsvc.js",
                    "js/services/tokensvc.js",
                    "js/services/proposalsvc.js",
                    "js/services/documentsvc.js",
                    "js/services/validationsvc.js",
                    filters="jsmin",
                    output="js/angular.min.%(version)s.js")

combined_sass = Bundle("sass/main.scss",
                       filters="pyscss",
                       output="css/main.min.css")

combined_css = Bundle("css/reset.css",
                      "lib/ngDialog/css/ngDialog.css",
                      "lib/ngDialog/css/ngDialog-theme-default.css",
                      "css/ngdialog-theme-login.css",
                      "css/ngdialog-theme-intromessage.css",
                      "css/ngdialog-theme-logout.css",
                      "lib/bigfoot/dist/bigfoot-default.css",
                      combined_sass,
                      filters="cssmin",
                      output="css/sbirez.min.%(version)s.css")

register("bower_js", bower_js)
register("angular_js", angular_js)
register("combined_css", combined_css)
Example #49
0
register('openhatch_css',
         Bundle("css/jquery.autocomplete.css",
                "openid/css/openid.css",
                "css/base/jquery.jgrowl.css",
                "css/search/search.css",
                "css/base/landing_page_for_logged_in_users.css",
                "css/profile/person_small.css",
                "css/project/project.css",
                "css/account/auth.css",
                "css/account/settings.css",
                "css/account/widget.css",
                "css/qunit.css",
                "css/profile/base.css",
                "css/profile/portfolio.css",
                "css/profile/search_people.css",
                "css/tipsy.css",
                "css/facebox.css",
                "css/missions/base.css",
                ),
         Bundle(#TODO: does assetizer follow includes inside css files?
                #"jquery-ui-1.7.3/themes/ui-lightness/ui.all.css",
                "jquery-ui-1.7.3/themes/base/ui.base.css",
                "jquery-ui-1.7.3/themes/ui-lightness/ui.theme.css",
                "jquery-ui-1.7.3/themes/base/ui.base.css",
                "jquery-ui-1.7.3/themes/base/ui.progressbar.css",
                "jquery-ui-1.7.3/themes/base/ui.tabs.css",
                #1.8.20:
                #"jquery-ui-1.7.3/themes/ui-lightness/jquery-ui.all.css",
                ),
         output="packed/openhatch.css")
register('header_js',
Example #50
0
from django_assets import Bundle, register

# css
base_css = Bundle(
    "css/bootstrap/bootstrap.min.css",
    "css/bootstrap/bootstrap-responsive.min.css",
    "css/jquery-ui.css",
    "css/chosen.css",
)

project_css = Bundle("css/project.scss", filters="pyscss,cssmin")

register("styles", Bundle(base_css, project_css, output="css/style.css"))

# js
base_js = Bundle(
    "js/jquery/jquery.min.js",
    "js/jquery/jquery-ui.min.js",
    "js/jquery/jquery.numeric.min.js",
    "js/jquery/jquery.chosen.min.js",
    "js/bootstrap/bootstrap.min.js",
    "js/underscore/underscore-min.js",
)

project_js = Bundle("js/project.coffee", filters="coffeescript")

register("scripts", Bundle(base_js, project_js, output="js/scripts.js"))
Example #51
0
except ImportError:
    DJANGO_ASSETS_INSTALLED = False
else:
    DJANGO_ASSETS_INSTALLED = True

    AVALAIBLE_BUNDLES = {
        'djangotribune_css': Bundle(
            "css/djangotribune/frontend.css",
            filters='yui_css',
            output='css/djangotribune.min.css'
        ),
        'djangotribune_js': Bundle(
            "js/jquery/jquery.querystring.js",
            "js/jquery/jquery.cookies.2.2.0.js",
            "js/jquery/jquery-textrange.js",
            "js/jquery/jwerty.0.3.2.9.js",
            "js/djangotribune/csrf.js",
            "js/djangotribune/main.js",
            filters='yui_js',
            output='js/djangotribune.min.js'
        ),
    }

    ENABLED_BUNDLES = (
        'djangotribune_css',
        'djangotribune_js',
    )

    for item in ENABLED_BUNDLES:
        register(item, AVALAIBLE_BUNDLES[item])
Example #52
0
import os

from django_assets import Bundle, register
from django.conf import settings

#pylint: disable=invalid-name

# All the CSS we need for the entire site. This tradeoff between
# bandwidth and latency is good as long as we have a high and consistent
# utilization of all the CSS tags for all pages on the site.
css_base = Bundle(os.path.join(settings.BASE_DIR,
                               'assets/less/base/base.less'),
                  filters=['less', 'cssmin'],
                  output='cache/base.css',
                  debug=False)
register('css_base', css_base)

css_email = Bundle(os.path.join(settings.BASE_DIR,
                                'assets/less/email/email.less'),
                   filters=['less', 'cssmin'],
                   output='cache/email.css',
                   debug=False)
register('css_email', css_email)

# Minimal: jquery and bootstrap always active on the site
js_base = Bundle('vendor/jquery.js',
                 'vendor/jquery.cookie.js',
                 'vendor/bootstrap.js',
                 'vendor/bootbox.js',
                 'vendor/toastr.js',
                 'js/djaodjin-dashboard.js',
Example #53
0
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.

from django_assets import Bundle, register

js_common = Bundle(
    'js/jquery/jquery.js', 'js/jquery/jquery.tipsy.js',
    'js/jquery/jquery.cookie.js', 'js/jquery/jquery.bidi.js',
    'js/jquery/jquery.fancybox.js', 'js/common.js', 'js/sorttable.js',
    'js/shortcut.js',
    filters='rjsmin', output='js/common.min.js')
register('js_common', js_common)

js_admin = Bundle(
    'js/admin.js',
    filters='rjsmin', output='js/admin.min.js')
register('js_admin', js_admin)

js_editor = Bundle(
    'js/jquery/jquery.easing.js', 'js/jquery/jquery.history.js',
    'js/jquery/jquery.tmpl.js', 'js/jquery/jquery.textarea-expander.js',
    'js/diff_match_patch.js', 'js/editor.js', 'js/json2.js',
    'js/jquery/jquery.fieldselection.js', 'js/jquery/jquery.caret.js',
    'js/jquery/jquery.highlightRegex.js', 'js/jquery/jquery.serializeObject.js',
    filters='rjsmin', output='js/editor.min.js')
register('js_editor', js_editor)
Example #54
0
# coding: utf-8

from django_assets import Bundle
from django_assets import register


home_css = Bundle('less/base/base.less',
                  'less/home/home.less',
                  filters='cssrewrite,less,cssmin',
                  output='css/home.css',
                  depends='less/*.less')

home_js = Bundle('coffee/base/base.coffee',
                 'coffee/home/home.coffee',
                 filters='coffeescript,jsmin',
                 # filters='coffeescript',
                 output='js/home.js')

register('home_css', home_css)
register('home_js', home_js)