Skip to content

Commit

Permalink
Automatically create options dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
humitos committed Sep 13, 2015
1 parent a193831 commit de4fa4f
Showing 1 changed file with 17 additions and 39 deletions.
56 changes: 17 additions & 39 deletions v7/nanogallery_directive/nanogallery_directive.py
Expand Up @@ -140,45 +140,23 @@ def _sanitize_options(self):
# We need to convert all the lowercase options (rst make them
# lowercase automatically) to the correct ones -supported by
# nanoGALLERY Javascript function
js_options = OrderedDict([
('theme', 'theme'),
('colorscheme', 'colorScheme'),
('rtl', 'RTL'),
('maxitemsperline', 'maxItemsPerLine'),
('maxwidth', 'maxWidth'),
('paginationdots', 'paginationDots'),
('paginationmaxlinesperpage', 'paginationMaxLinesPerPage'),
('paginationswipe', 'paginationSwipe'),
('locationhash', 'locationHash'),
('itemsselectable', 'itemsSelectable'),
('showcheckboxes', 'showCheckboxes'),
('checkboxstyle', 'checkboxStyle'),
('keepselection', 'keepSelection'),
('i18n', 'i18n'),
('lazybuild', 'lazyBuild'),
('lazybuildtreshold', 'lazyBuildTreshold'),
('openonstart', 'openOnStart'),
('breakpointsizesm', 'breakpointSizeSM'),
('breakpointsizeme', 'breakpointSizeME'),
('breakpointsizela', 'breakpointSizeLA'),
('breakpointsizexl', 'breakpointSizeXL'),
('thumbnailheight', 'thumbnailHeight'),
('thumbnailwidth', 'thumbnailWidth'),
('thumbnailalignment', 'thumbnailAlignment'),
('thumbnailgutterwidth', 'thumbnailGutterWidth'),
('thumbnailgutterheight', 'thumbnailGutterHeight'),
('thumbnailopenimage', 'thumbnailOpenImage'),
('thumbnaillabel', 'thumbnailLabel'),
('thumbnailhovereffect', 'thumbnailHoverEffect'),
('touchanimation', 'touchAnimation'),
('touchautoopendelay', 'touchAutoOpenDelay'),
('thumbnaildisplayinterval', 'thumbnailDisplayInterval'),
('thumbnaildisplaytransition', 'thumbnailDisplayTransition'),
('thumbnaillazyload', 'thumbnailLazyLoad'),
('thumbnaillazyloadtreshold', 'thumbnailLazyLoadTreshold'),
('thumbnailadjustlastrowheight', 'thumbnailAdjustLastRowHeight'),
('thumbnailalbumdisplayimage', 'thumbnailAlbumDisplayImage')
])
js_options = [
'theme', 'colorScheme', 'RTL', 'maxItemsPerLine',
'maxWidth', 'paginationDots', 'paginationMaxLinesPerPage',
'paginationSwipe', 'locationHash', 'itemsSelectable',
'showCheckboxes', 'checkboxStyle', 'keepSelection',
'i18n', 'lazyBuild', 'lazyBuildTreshold', 'openOnStart',
'breakpointSizeSM', 'breakpointSizeME', 'breakpointSizeLA',
'breakpointSizeXL', 'thumbnailHeight', 'thumbnailWidth',
'thumbnailAlignment', 'thumbnailGutterWidth',
'thumbnailGutterHeight', 'thumbnailOpenImage',
'thumbnailLabel', 'thumbnailHoverEffect',
'touchAnimation', 'touchAutoOpenDelay',
'thumbnailDisplayInterval', 'thumbnailDisplayTransition',
'thumbnailLazyLoad', 'thumbnailLazyLoadTreshold',
'thumbnailAdjustLastRowHeight', 'thumbnailAlbumDisplayImage'
]
js_options = {o.lower(): o for o in js_options}

options = {}
for k in defaults:
Expand Down

0 comments on commit de4fa4f

Please sign in to comment.