Skip to content

Instantly share code, notes, and snippets.

@trevorparscal
Created November 17, 2014 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trevorparscal/265f1b8c854190637a1e to your computer and use it in GitHub Desktop.
Save trevorparscal/265f1b8c854190637a1e to your computer and use it in GitHub Desktop.
# Execute this in the root of the ve mw repo
# Find and replace script symbols
find modules -name \*.js -exec sed -i '' \
-e 's/MWInternalLinkMenuItemWidget/MWInternalLinkMenuOptionWidget/g' \
-e 's/MWLinkMenuItemWidget/MWLinkMenuOptionWidget/g' \
-e 's/ContextMenuWidget/ContextSelectWidget/g' \
-e 's/ContextItemWidget/ContextOptionWidget/g' \
-e 's/TextInputMenuWidget/TextInputMenuSelectWidget/g' \
-e 's/MenuWidget/MenuSelectWidget/g' \
-e 's/MenuItemWidget/MenuOptionWidget/g' \
-e 's/MenuSectionItemWidget/MenuSectionOptionWidget/g' \
-e 's/OutlineWidget/OutlineSelectWidget/g' \
-e 's/OutlineItemWidget/OutlineOptionWidget/g' \
-e 's/contextMenuWidget/contextSelectWidget/g' \
-e 's/contextItemWidget/contextOptionWidget/g' \
-e 's/textInputMenuWidget/textInputMenuSelectWidget/g' \
-e 's/menuWidget/menuSelectWidget/g' \
-e 's/menuItemWidget/menuOptionWidget/g' \
-e 's/menuSectionItemWidget/menuSectionOptionWidget/g' \
-e 's/outlineWidget/outlineSelectWidget/g' \
-e 's/outlineItemWidget/outlineOptionWidget/g' {} +
# Find and replace style symbols
find modules -name \*.css -exec sed -i '' \
-e 's/contextMenuWidget/contextSelectWidget/g' \
-e 's/contextItemWidget/contextOptionWidget/g' \
-e 's/textInputMenuWidget/textInputMenuSelectWidget/g' \
-e 's/menuWidget/menuSelectWidget/g' \
-e 's/menuItemWidget/menuOptionWidget/g' \
-e 's/menuSectionItemWidget/menuSectionOptionWidget/g' \
-e 's/outlineWidget/outlineSelectWidget/g' \
-e 's/outlineItemWidget/outlineOptionWidget/g' {} +
# Find and replace file references
find . -name VisualEditor.php -exec sed -i '' \
-e 's/ve\.ui\.MWInternalLinkMenuItemWidget.js/ve\.ui\.MWInternalLinkMenuOptionWidget.js/g' \
-e 's/ve\.ui\.MWLinkMenuItemWidget.js/ve\.ui\.MWLinkMenuOptionWidget.js/g' \
-e 's/ve\.ui\.ContextMenuWidget\.js/ve\.ui\.ContextSelectWidget\.js/g' \
-e 's/ve\.ui\.ContextItemWidget\.js/ve\.ui\.ContextOptionWidget\.js/g' \
-e 's/ve\.ui\.ContextMenuWidget\.css/ve\.ui\.ContextSelectWidget\.css/g' \
-e 's/ve\.ui\.ContextItemWidget\.css/ve\.ui\.ContextOptionWidget\.css/g' {} +
# Move scripts
cd modules/ve-mw/ui/widgets
mv ve.ui.MWInternalLinkMenuItemWidget.js ve.ui.MWInternalLinkMenuOptionWidget.js
mv ve.ui.MWLinkMenuItemWidget.js ve.ui.MWLinkMenuOptionWidget.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment