diff --git a/.htaccess b/.htaccess index 9f630df0ae681..bef5869dd2fdf 100644 --- a/.htaccess +++ b/.htaccess @@ -1,5 +1,6 @@ ############################################ -## uncomment the line below to enable developer mode +## overrides deployment configuration mode value +## use command bin/magento deploy:mode:set to switch modes # SetEnv MAGE_MODE developer diff --git a/app/code/Magento/Backend/Model/View/Result/Page.php b/app/code/Magento/Backend/Model/View/Result/Page.php index e81e4d982700c..1386628a8d511 100644 --- a/app/code/Magento/Backend/Model/View/Result/Page.php +++ b/app/code/Magento/Backend/Model/View/Result/Page.php @@ -76,7 +76,11 @@ public function setActiveMenu($itemId) */ public function addBreadcrumb($label, $title, $link = null) { - $this->layout->getBlock('breadcrumbs')->addLink($label, $title, $link); + /** @var \Magento\Backend\Block\Widget\Breadcrumbs $block */ + $block = $this->layout->getBlock('breadcrumbs'); + if ($block) { + $block->addLink($label, $title, $link); + } return $this; } diff --git a/app/code/Magento/Backend/Test/Unit/Model/View/Result/PageTest.php b/app/code/Magento/Backend/Test/Unit/Model/View/Result/PageTest.php new file mode 100644 index 0000000000000..19f7f6e390ea9 --- /dev/null +++ b/app/code/Magento/Backend/Test/Unit/Model/View/Result/PageTest.php @@ -0,0 +1,89 @@ +layoutMock = $this->getMockBuilder('Magento\Framework\View\LayoutInterface') + ->setMethods(['setGeneratorPool']) + ->getMockForAbstractClass(); + $this->breadcrumbsBlockMock = $this->getMockBuilder('Magento\Backend\Block\Widget\Breadcrumbs') + ->disableOriginalConstructor() + ->getMock(); + + $this->objectManagerHelper = new ObjectManagerHelper($this); + $this->context = $this->objectManagerHelper->getObject( + 'Magento\Framework\View\Element\Template\Context', + ['layout' => $this->layoutMock] + ); + $this->resultPage = $this->objectManagerHelper->getObject( + 'Magento\Backend\Model\View\Result\Page', + ['context' => $this->context] + ); + } + + public function testAddBreadcrumb() + { + $label = 'label'; + $title = 'title'; + $link = '/link'; + + $this->layoutMock->expects($this->once()) + ->method('getBlock') + ->with('breadcrumbs') + ->willReturn($this->breadcrumbsBlockMock); + $this->breadcrumbsBlockMock->expects($this->once()) + ->method('addLink') + ->with($label, $title, $link) + ->willReturnSelf(); + + $this->assertSame($this->resultPage, $this->resultPage->addBreadcrumb($label, $title, $link)); + } + + public function testAddBreadcrumbNoBlock() + { + $label = 'label'; + $title = 'title'; + + $this->layoutMock->expects($this->once()) + ->method('getBlock') + ->with('breadcrumbs') + ->willReturn(false); + $this->breadcrumbsBlockMock->expects($this->never()) + ->method('addLink'); + + $this->assertSame($this->resultPage, $this->resultPage->addBreadcrumb($label, $title)); + } +} diff --git a/app/code/Magento/Backend/view/adminhtml/layout/admin_login.xml b/app/code/Magento/Backend/view/adminhtml/layout/admin_login.xml index 35b8eebed0c28..b0891c464f5f3 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/admin_login.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/admin_login.xml @@ -9,15 +9,14 @@ - - - - - - + + + + + - - + + diff --git a/app/code/Magento/Backend/view/adminhtml/layout/popup.xml b/app/code/Magento/Backend/view/adminhtml/layout/popup.xml index 17da4d9b56eb7..e6f59c729501d 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/popup.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/popup.xml @@ -7,7 +7,7 @@ --> - - + + diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php index 9e15c4246cc04..6d444009f5a77 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php @@ -73,9 +73,10 @@ public function dispatch(\Magento\Framework\App\RequestInterface $request) } /** + * @param \Magento\Framework\Phrase|null $title * @return \Magento\Backend\Model\View\Result\Page */ - protected function createActionPage() + protected function createActionPage($title = null) { /** @var \Magento\Backend\Model\View\Result\Page $resultPage */ $resultPage = $this->resultPageFactory->create(); @@ -91,6 +92,9 @@ protected function createActionPage() $resultPage->addBreadcrumb(__('Catalog'), __('Catalog')) ->addBreadcrumb(__('Manage Product Attributes'), __('Manage Product Attributes')) ->setActiveMenu('Magento_Catalog::catalog_attributes_attributes'); + if (!empty($title)) { + $resultPage->addBreadcrumb($title, $title); + } } $resultPage->getConfig()->getTitle()->prepend(__('Product Attributes')); return $resultPage; diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Edit.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Edit.php index f149ff2506a6c..8aa19c8c91110 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Edit.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Edit.php @@ -52,9 +52,8 @@ public function execute() $item = $id ? __('Edit Product Attribute') : __('New Product Attribute'); - $resultPage = $this->createActionPage(); + $resultPage = $this->createActionPage($item); $resultPage->getConfig()->getTitle()->prepend($id ? $model->getName() : __('New Product Attribute')); - $resultPage->addBreadcrumb($item, $item); $resultPage->getLayout() ->getBlock('attribute_edit_js') ->setIsPopup((bool)$this->getRequest()->getParam('popup')); diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/MassStatus.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/MassStatus.php index 8e1dd606e5e19..b37fed05c1e54 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/MassStatus.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/MassStatus.php @@ -57,7 +57,7 @@ public function _validateMassStatus(array $productIds, $status) */ public function execute() { - $productIds = (array) $this->getRequest()->getParam('product'); + $productIds = (array) $this->getRequest()->getParam('selected'); $storeId = (int) $this->getRequest()->getParam('store', 0); $status = (int) $this->getRequest()->getParam('status'); diff --git a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Attribute/EditTest.php b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Attribute/EditTest.php new file mode 100644 index 0000000000000..294860b66a912 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Attribute/EditTest.php @@ -0,0 +1,255 @@ +request = $this->getMockBuilder('Magento\Framework\App\RequestInterface')->getMock(); + + $this->objectManagerMock = $this->getMockBuilder('Magento\Framework\ObjectManagerInterface')->getMock(); + + $this->eavAttribute = $this->getMock( + 'Magento\Catalog\Model\Resource\Eav\Attribute', + ['setEntityTypeId', 'load', 'getId', 'getEntityTypeId', 'addData', 'getName'], + [], + '', + false + ); + + $this->registry = $this->getMock('Magento\Framework\Registry', [], [], '', false); + + $this->resultPage = $this->getMockBuilder('Magento\Backend\Model\View\Result\Page') + ->disableOriginalConstructor() + ->setMethods(['setActiveMenu', 'getConfig', 'addBreadcrumb', 'addHandle', 'getLayout']) + ->getMock(); + + $this->resultPageFactory = $this->getMockBuilder('Magento\Framework\View\Result\PageFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + + $this->resultLayout = $this->getMockBuilder('Magento\Framework\View\Result\Layout') + ->disableOriginalConstructor() + ->getMock(); + + $this->pageConfig = $this->getMockBuilder('Magento\Framework\View\Page\Config') + ->disableOriginalConstructor() + ->getMock(); + + $this->pageTitle = $this->getMockBuilder('Magento\Framework\View\Page\Title') + ->disableOriginalConstructor() + ->getMock(); + + $this->layout = $this->getMock('Magento\Framework\View\Layout', ['getBlock'], [], '', false); + + $this->session = $this->getMockBuilder('Magento\Backend\Model\Session') + ->disableOriginalConstructor() + ->getMock(); + + $this->blockTemplate = $this->getMockBuilder('Magento\Backend\Block\Template') + ->disableOriginalConstructor() + ->getMock(); + + $this->context = $this->getMock('Magento\Backend\App\Action\Context', [], [], '', false); + $this->context->expects($this->any())->method('getRequest')->willReturn($this->request); + $this->context->expects($this->any())->method('getObjectManager')->willReturn($this->objectManagerMock); + $this->context->expects($this->any())->method('getResultPageFactory')->willReturn($this->resultPageFactory); + $this->context->expects($this->any())->method('getSession')->willReturn($this->session); + + $this->objectManager = new ObjectManager($this); + $this->editController = $this->objectManager->getObject( + 'Magento\Catalog\Controller\Adminhtml\Product\Attribute\Edit', + [ + 'context' => $this->context, + 'resultPageFactory' => $this->resultPageFactory + ] + ); + } + + public function testExecutePopup() + { + $attributesData = ['frontend_label' => '']; + + $this->request->expects($this->any())->method('getParam')->willReturnMap( + [ + ['attribute_id', null, null], + ['attribute', null, $attributesData], + ['popup', null, '1'], + ['product_tab', null, null] + ] + ); + + $this->objectManagerMock->expects($this->any())->method('create') + ->with('Magento\Catalog\Model\Resource\Eav\Attribute') + ->willReturn($this->eavAttribute); + $this->objectManagerMock->expects($this->any())->method('get') + ->with('Magento\Backend\Model\Session') + ->willReturn($this->session); + + $this->eavAttribute->expects($this->once())->method('setEntityTypeId')->willReturnSelf(); + $this->eavAttribute->expects($this->once())->method('addData')->with($attributesData)->willReturnSelf(); + $this->eavAttribute->expects($this->any())->method('getName')->willReturn(null); + + $this->registry->expects($this->any()) + ->method('register') + ->with('entity_attribute', $this->eavAttribute); + + $this->resultPage->expects($this->once()) + ->method('addHandle') + ->with(['popup', 'catalog_product_attribute_edit_popup']) + ->willReturnSelf(); + $this->resultPage->expects($this->any())->method('getConfig')->willReturn($this->pageConfig); + $this->resultPage->expects($this->once())->method('getLayout')->willReturn($this->layout); + + $this->resultPageFactory->expects($this->atLeastOnce()) + ->method('create') + ->willReturn($this->resultPage); + + $this->pageConfig->expects($this->any())->method('addBodyClass')->willReturnSelf(); + $this->pageConfig->expects($this->any())->method('getTitle')->willReturn($this->pageTitle); + + $this->pageTitle->expects($this->any())->method('prepend')->willReturnSelf(); + + $this->layout->expects($this->once())->method('getBlock')->willReturn($this->blockTemplate); + + $this->blockTemplate->expects($this->any())->method('setIsPopup')->willReturnSelf(); + + $this->assertSame($this->resultPage, $this->editController->execute()); + } + + public function testExecuteNoPopup() + { + $attributesData = ['frontend_label' => '']; + + $this->request->expects($this->any())->method('getParam')->willReturnMap( + [ + ['attribute_id', null, null], + ['attribute', null, $attributesData], + ['popup', null, false], + ] + ); + + $this->objectManagerMock->expects($this->any())->method('create') + ->with('Magento\Catalog\Model\Resource\Eav\Attribute') + ->willReturn($this->eavAttribute); + $this->objectManagerMock->expects($this->any())->method('get') + ->with('Magento\Backend\Model\Session') + ->willReturn($this->session); + + $this->eavAttribute->expects($this->once())->method('setEntityTypeId')->willReturnSelf(); + $this->eavAttribute->expects($this->once())->method('addData')->with($attributesData)->willReturnSelf(); + + $this->registry->expects($this->any()) + ->method('register') + ->with('entity_attribute', $this->eavAttribute); + + $this->resultPage->expects($this->any())->method('addBreadcrumb')->willReturnSelf(); + $this->resultPage->expects($this->once()) + ->method('setActiveMenu') + ->with('Magento_Catalog::catalog_attributes_attributes') + ->willReturnSelf(); + $this->resultPage->expects($this->any())->method('getConfig')->willReturn($this->pageConfig); + $this->resultPage->expects($this->once())->method('getLayout')->willReturn($this->layout); + + $this->resultPageFactory->expects($this->atLeastOnce()) + ->method('create') + ->willReturn($this->resultPage); + + $this->pageConfig->expects($this->any())->method('getTitle')->willReturn($this->pageTitle); + + $this->pageTitle->expects($this->any())->method('prepend')->willReturnSelf(); + + $this->eavAttribute->expects($this->any())->method('getName')->willReturn(null); + + $this->layout->expects($this->once())->method('getBlock')->willReturn($this->blockTemplate); + + $this->blockTemplate->expects($this->any())->method('setIsPopup')->willReturnSelf(); + + $this->assertSame($this->resultPage, $this->editController->execute()); + } +} diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit_popup.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit_popup.xml old mode 100644 new mode 100755 index 82899deca4005..3e99afa0dbeac --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit_popup.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_attribute_edit_popup.xml @@ -5,9 +5,11 @@ * See COPYING.txt for license details. */ --> - + - + + + diff --git a/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml b/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml index c375e94de8ca2..26e38498375f6 100644 --- a/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml +++ b/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml @@ -210,12 +210,12 @@ enable Enable - catalog/product/massEnable + catalog/product/massStatus/status/1 disable Disable - catalog/product/massDisable + catalog/product/massStatus/status/2 diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_gallery.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_gallery.xml old mode 100644 new mode 100755 index d29b981fd47cb..3eba65002e1a2 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_gallery.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_gallery.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> - + diff --git a/app/code/Magento/CatalogInventory/Ui/DataProvider/Product/AddQuantityFilterToCollection.php b/app/code/Magento/CatalogInventory/Ui/DataProvider/Product/AddQuantityFilterToCollection.php index d1b14ad2b21b6..0c4617dac08eb 100644 --- a/app/code/Magento/CatalogInventory/Ui/DataProvider/Product/AddQuantityFilterToCollection.php +++ b/app/code/Magento/CatalogInventory/Ui/DataProvider/Product/AddQuantityFilterToCollection.php @@ -19,16 +19,16 @@ class AddQuantityFilterToCollection implements AddFilterToCollectionInterface */ public function addFilter(Collection $collection, $field, $condition = null) { - if (isset($condition['from'])) { + if (isset($condition['gteq'])) { $collection->getSelect()->where( AbstractCollection::ATTRIBUTE_TABLE_ALIAS_PREFIX . 'qty.qty >= ?', - (float)$condition['from'] + (float)$condition['gteq'] ); } - if ($condition['to']) { + if (isset($condition['lteq'])) { $collection->getSelect()->where( AbstractCollection::ATTRIBUTE_TABLE_ALIAS_PREFIX . 'qty.qty <= ?', - (float)$condition['to'] + (float)$condition['lteq'] ); } } diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_index_index.xml index be5917f36ba62..500a2459192ea 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_index_index.xml @@ -411,6 +411,6 @@ - + diff --git a/app/code/Magento/Cms/Model/Resource/AbstractCollection.php b/app/code/Magento/Cms/Model/Resource/AbstractCollection.php index 5d4f961877c59..48188c96b7706 100644 --- a/app/code/Magento/Cms/Model/Resource/AbstractCollection.php +++ b/app/code/Magento/Cms/Model/Resource/AbstractCollection.php @@ -5,132 +5,159 @@ */ namespace Magento\Cms\Model\Resource; -use Magento\Framework\Data\AbstractSearchResult; -use Magento\Store\Model\StoreManagerInterface; -use Magento\Framework\Data\SearchResultProcessorFactory; -use Magento\Framework\Data\SearchResultProcessor; -use Magento\Framework\DB\QueryInterface; -use Magento\Framework\Data\Collection\EntityFactoryInterface; -use Magento\Framework\Event\ManagerInterface; -use Magento\Framework\Data\SearchResultIteratorFactory; - /** - * CMS block model + * Abstract collection of CMS pages and blocks */ -class AbstractCollection extends AbstractSearchResult +abstract class AbstractCollection extends \Magento\Framework\Model\Resource\Db\Collection\AbstractCollection { /** + * Store manager + * * @var \Magento\Store\Model\StoreManagerInterface */ protected $storeManager; /** - * @var SearchResultProcessor + * @param \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory + * @param \Psr\Log\LoggerInterface $logger + * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy + * @param \Magento\Framework\Event\ManagerInterface $eventManager + * @param \Magento\Store\Model\StoreManagerInterface $storeManager + * @param \Magento\Framework\DB\Adapter\AdapterInterface|null $connection + * @param \Magento\Framework\Model\Resource\Db\AbstractDb|null $resource */ - protected $searchResultProcessor; + public function __construct( + \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory, + \Psr\Log\LoggerInterface $logger, + \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, + \Magento\Framework\Event\ManagerInterface $eventManager, + \Magento\Store\Model\StoreManagerInterface $storeManager, + \Magento\Framework\DB\Adapter\AdapterInterface $connection = null, + \Magento\Framework\Model\Resource\Db\AbstractDb $resource = null + ) { + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); + $this->storeManager = $storeManager; + } /** - * Table which links CMS entity to stores + * Perform operations after collection load * - * @var string + * @param string $tableName + * @param string $columnName + * @return void */ - protected $storeTableName; + protected function performAfterLoad($tableName, $columnName) + { + $items = $this->getColumnValues($columnName); + if (count($items)) { + $connection = $this->getConnection(); + $select = $connection->select()->from(['cms_entity_store' => $this->getTable($tableName)]) + ->where('cms_entity_store.' . $columnName . ' IN (?)', $items); + $result = $connection->fetchPairs($select); + if ($result) { + foreach ($this as $item) { + $entityId = $item->getData($columnName); + if (!isset($result[$entityId])) { + continue; + } + if ($result[$entityId] == 0) { + $stores = $this->storeManager->getStores(false, true); + $storeId = current($stores)->getId(); + $storeCode = key($stores); + } else { + $storeId = $result[$item->getData($columnName)]; + $storeCode = $this->storeManager->getStore($storeId)->getCode(); + } + $item->setData('_first_store_id', $storeId); + $item->setData('store_code', $storeCode); + $item->setData('store_id', [$result[$entityId]]); + } + } + } + } /** - * @var string + * Add field filter to collection + * + * @param array|string $field + * @param string|int|array|null $condition + * @return $this */ - protected $linkFieldName; + public function addFieldToFilter($field, $condition = null) + { + if ($field === 'store_id') { + return $this->addStoreFilter($condition, false); + } + + return parent::addFieldToFilter($field, $condition); + } /** - * @param QueryInterface $query - * @param EntityFactoryInterface $entityFactory - * @param ManagerInterface $eventManager - * @param SearchResultIteratorFactory $resultIteratorFactory - * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param SearchResultProcessorFactory $searchResultProcessorFactory + * Add filter by store + * + * @param int|array|\Magento\Store\Model\Store $store + * @param bool $withAdmin + * @return $this */ - public function __construct( - QueryInterface $query, - EntityFactoryInterface $entityFactory, - ManagerInterface $eventManager, - SearchResultIteratorFactory $resultIteratorFactory, - StoreManagerInterface $storeManager, - SearchResultProcessorFactory $searchResultProcessorFactory - ) { - $this->storeManager = $storeManager; - $this->searchResultProcessor = $searchResultProcessorFactory->create($this); - parent::__construct($query, $entityFactory, $eventManager, $resultIteratorFactory); - } + abstract public function addStoreFilter($store, $withAdmin = true); /** + * Perform adding filter by store + * + * @param int|array|\Magento\Store\Model\Store $store + * @param bool $withAdmin * @return void */ - protected function init() + protected function performAddStoreFilter($store, $withAdmin = true) { - $this->query->addCountSqlSkipPart(\Magento\Framework\DB\Select::GROUP, true); + if ($store instanceof \Magento\Store\Model\Store) { + $store = [$store->getId()]; + } + + if (!is_array($store)) { + $store = [$store]; + } + + if ($withAdmin) { + $store[] = \Magento\Store\Model\Store::DEFAULT_STORE_ID; + } + + $this->addFilter('store', ['in' => $store], 'public'); } /** - * @return array + * Join store relation table if there is store filter + * + * @param string $tableName + * @param string $columnName + * @return void */ - public function toOptionIdArray() + protected function joinStoreRelationTable($tableName, $columnName) { - $res = []; - $existingIdentifiers = []; - foreach ($this->getItems() as $item) { - /** @var \Magento\Cms\Model\Block|\Magento\Cms\Model\Page $item */ - $identifier = $item->getIdentifier(); - - $data['value'] = $identifier; - $data['label'] = $item->getTitle(); - - if (in_array($identifier, $existingIdentifiers)) { - $data['value'] .= '|' . $item->getId(); - } else { - $existingIdentifiers[] = $identifier; - } - $res[] = $data; + if ($this->getFilter('store')) { + $this->getSelect()->join( + ['store_table' => $this->getTable($tableName)], + 'main_table.' . $columnName . ' = store_table.' . $columnName, + [] + )->group( + 'main_table.' . $columnName + ); } - return $res; + parent::_renderFiltersBefore(); } /** - * Perform operations after collection load + * Get SQL for get record count * - * @return void + * Extra GROUP BY strip added. + * + * @return \Magento\Framework\DB\Select */ - protected function afterLoad() + public function getSelectCountSql() { - if ($this->getSearchCriteria()->getPart('first_store_flag')) { - $items = $this->searchResultProcessor->getColumnValues($this->linkFieldName); + $countSelect = parent::getSelectCountSql(); + $countSelect->reset(\Magento\Framework\DB\Select::GROUP); - $connection = $this->getQuery()->getConnection(); - $resource = $this->getQuery()->getResource(); - if (count($items)) { - $select = $connection->select()->from(['cps' => $resource->getTable($this->storeTableName)]) - ->where("cps.{$this->linkFieldName} IN (?)", $items); - $result = $connection->fetchPairs($select); - if ($result) { - foreach ($this->getItems() as $item) { - /** @var BlockInterface $item */ - if (!isset($result[$item->getId()])) { - continue; - } - if ($result[$item->getId()] == 0) { - $stores = $this->storeManager->getStores(false, true); - $storeId = current($stores)->getId(); - $storeCode = key($stores); - } else { - $storeId = $result[$item->getId()]; - $storeCode = $this->storeManager->getStore($storeId)->getCode(); - } - $item->setData('_first_store_id', $storeId); - $item->setData('store_code', $storeCode); - $item->setData('store_id', [$result[$item->getId()]]); - } - } - } - } - parent::afterLoad(); + return $countSelect; } } diff --git a/app/code/Magento/Cms/Model/Resource/Block/Collection.php b/app/code/Magento/Cms/Model/Resource/Block/Collection.php index bb7657bdb357f..2a355ca47bcd6 100644 --- a/app/code/Magento/Cms/Model/Resource/Block/Collection.php +++ b/app/code/Magento/Cms/Model/Resource/Block/Collection.php @@ -1,16 +1,16 @@ walk('afterLoad'); - parent::_afterLoad(); - } + $this->performAfterLoad('cms_block_store', 'block_id'); - /** - * @param string|array $field - * @param string|int|array|null $condition - * @return \Magento\Cms\Model\Resource\Block\Collection - */ - public function addFieldToFilter($field, $condition = null) - { - if ($field == 'store_id') { - return $this->addStoreFilter($condition, false); - } - return parent::addFieldToFilter($field, $condition); + return parent::_afterLoad(); } /** @@ -63,44 +53,17 @@ public function toOptionArray() /** * Add filter by store * - * @param int|\Magento\Store\Model\Store $store + * @param int|array|\Magento\Store\Model\Store $store * @param bool $withAdmin * @return $this */ public function addStoreFilter($store, $withAdmin = true) { - if ($store instanceof \Magento\Store\Model\Store) { - $store = [$store->getId()]; - } - - if (!is_array($store)) { - $store = [$store]; - } - - if ($withAdmin) { - $store[] = \Magento\Store\Model\Store::DEFAULT_STORE_ID; - } - - $this->addFilter('store', ['in' => $store], 'public'); + $this->performAddStoreFilter($store, $withAdmin); return $this; } - /** - * Get SQL for get record count. - * Extra GROUP BY strip added. - * - * @return \Magento\Framework\DB\Select - */ - public function getSelectCountSql() - { - $countSelect = parent::getSelectCountSql(); - - $countSelect->reset(\Magento\Framework\DB\Select::GROUP); - - return $countSelect; - } - /** * Join store relation table if there is store filter * @@ -108,15 +71,6 @@ public function getSelectCountSql() */ protected function _renderFiltersBefore() { - if ($this->getFilter('store')) { - $this->getSelect()->join( - ['store_table' => $this->getTable('cms_block_store')], - 'main_table.block_id = store_table.block_id', - [] - )->group( - 'main_table.block_id' - ); - } - parent::_renderFiltersBefore(); + $this->joinStoreRelationTable('cms_block_store', 'block_id'); } } diff --git a/app/code/Magento/Cms/Model/Resource/Block/Grid/Collection.php b/app/code/Magento/Cms/Model/Resource/Block/Grid/Collection.php index 7d8193c4bab99..6f3759681ab8e 100644 --- a/app/code/Magento/Cms/Model/Resource/Block/Grid/Collection.php +++ b/app/code/Magento/Cms/Model/Resource/Block/Grid/Collection.php @@ -10,8 +10,7 @@ use Magento\Cms\Model\Resource\Block\Collection as BlockCollection; /** - * Class Collection - * Collection for displaying grid of sales documents + * Collection for displaying grid of cms blocks */ class Collection extends BlockCollection implements SearchResultInterface { @@ -25,8 +24,9 @@ class Collection extends BlockCollection implements SearchResultInterface * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager - * @param null|\Zend_Db_Adapter_Abstract $mainTable - * @param \Magento\Framework\Model\Resource\Db\AbstractDb $eventPrefix + * @param \Magento\Store\Model\StoreManagerInterface $storeManager + * @param string $mainTable + * @param string $eventPrefix * @param string $eventObject * @param string $resourceModel * @param string $model @@ -40,6 +40,7 @@ public function __construct( \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, + \Magento\Store\Model\StoreManagerInterface $storeManager, $mainTable, $eventPrefix, $eventObject, @@ -53,6 +54,7 @@ public function __construct( $logger, $fetchStrategy, $eventManager, + $storeManager, $connection, $resource ); diff --git a/app/code/Magento/Cms/Model/Resource/Page/Collection.php b/app/code/Magento/Cms/Model/Resource/Page/Collection.php index b8eadc87623f8..8ef01de72f127 100644 --- a/app/code/Magento/Cms/Model/Resource/Page/Collection.php +++ b/app/code/Magento/Cms/Model/Resource/Page/Collection.php @@ -5,12 +5,12 @@ */ namespace Magento\Cms\Model\Resource\Page; +use \Magento\Cms\Model\Resource\AbstractCollection; + /** * CMS page collection - * - * Class Collection */ -class Collection extends \Magento\Framework\Model\Resource\Db\Collection\AbstractCollection +class Collection extends AbstractCollection { /** * @var string @@ -24,35 +24,6 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ protected $_previewFlag; - /** - * Store manager - * - * @var \Magento\Store\Model\StoreManagerInterface - */ - protected $_storeManager; - - /** - * @param \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory - * @param \Psr\Log\LoggerInterface $logger - * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Framework\Event\ManagerInterface $eventManager - * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param mixed $connection - * @param \Magento\Framework\Model\Resource\Db\AbstractDb $resource - */ - public function __construct( - \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory, - \Psr\Log\LoggerInterface $logger, - \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Framework\Event\ManagerInterface $eventManager, - \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\DB\Adapter\AdapterInterface $connection = null, - \Magento\Framework\Model\Resource\Db\AbstractDb $resource = null - ) { - parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); - $this->_storeManager = $storeManager; - } - /** * Define resource model * @@ -105,45 +76,17 @@ public function setFirstStoreFlag($flag = false) return $this; } - /** - * Add field filter to collection - * - * @param string|array $field - * @param string|int|array|null $condition - * @return \Magento\Cms\Model\Resource\Block\Collection - */ - public function addFieldToFilter($field, $condition = null) - { - if ($field === 'store_id') { - return $this->addStoreFilter($condition, false); - } - - return parent::addFieldToFilter($field, $condition); - } - /** * Add filter by store * - * @param int|\Magento\Store\Model\Store $store + * @param int|array|\Magento\Store\Model\Store $store * @param bool $withAdmin * @return $this */ public function addStoreFilter($store, $withAdmin = true) { if (!$this->getFlag('store_filter_added')) { - if ($store instanceof \Magento\Store\Model\Store) { - $store = [$store->getId()]; - } - - if (!is_array($store)) { - $store = [$store]; - } - - if ($withAdmin) { - $store[] = \Magento\Store\Model\Store::DEFAULT_STORE_ID; - } - - $this->addFilter('store', ['in' => $store], 'public'); + $this->performAddStoreFilter($store, $withAdmin); } return $this; } @@ -155,67 +98,19 @@ public function addStoreFilter($store, $withAdmin = true) */ protected function _afterLoad() { - $items = $this->getColumnValues('page_id'); - if (count($items)) { - $connection = $this->getConnection(); - $select = $connection->select()->from(['cps' => $this->getTable('cms_page_store')]) - ->where('cps.page_id IN (?)', $items); - $result = $connection->fetchPairs($select); - if ($result) { - foreach ($this as $item) { - $pageId = $item->getData('page_id'); - if (!isset($result[$pageId])) { - continue; - } - if ($result[$pageId] == 0) { - $stores = $this->_storeManager->getStores(false, true); - $storeId = current($stores)->getId(); - $storeCode = key($stores); - } else { - $storeId = $result[$item->getData('page_id')]; - $storeCode = $this->_storeManager->getStore($storeId)->getCode(); - } - $item->setData('_first_store_id', $storeId); - $item->setData('store_code', $storeCode); - $item->setData('store_id', [$result[$pageId]]); - } - } - } - + $this->performAfterLoad('cms_page_store', 'page_id'); $this->_previewFlag = false; + return parent::_afterLoad(); } /** - * Join store relation table if there is store filter + * Perform operations before rendering filters * * @return void */ protected function _renderFiltersBefore() { - if ($this->getFilter('store')) { - $this->getSelect()->join( - ['store_table' => $this->getTable('cms_page_store')], - 'main_table.page_id = store_table.page_id', - [] - )->group( - 'main_table.page_id' - ); - } - parent::_renderFiltersBefore(); - } - - /** - * Get SQL for get record count. - * Extra GROUP BY strip added. - * - * @return \Magento\Framework\DB\Select - */ - public function getSelectCountSql() - { - $countSelect = parent::getSelectCountSql(); - $countSelect->reset(\Magento\Framework\DB\Select::GROUP); - - return $countSelect; + $this->joinStoreRelationTable('cms_page_store', 'page_id'); } } diff --git a/app/code/Magento/Cms/Test/Unit/Model/Resource/AbstractCollectionTest.php b/app/code/Magento/Cms/Test/Unit/Model/Resource/AbstractCollectionTest.php new file mode 100644 index 0000000000000..0f091388cc785 --- /dev/null +++ b/app/code/Magento/Cms/Test/Unit/Model/Resource/AbstractCollectionTest.php @@ -0,0 +1,51 @@ +select = $this->getMockBuilder('Magento\Framework\DB\Select') + ->disableOriginalConstructor() + ->getMock(); + + $this->connection = $this->getMockBuilder('Magento\Framework\DB\Adapter\Pdo\Mysql') + ->disableOriginalConstructor() + ->getMock(); + $this->connection->expects($this->any())->method('select')->willReturn($this->select); + + $this->resource = $this->getMockBuilder('Magento\Framework\Model\Resource\Db\AbstractDb') + ->disableOriginalConstructor() + ->setMethods(['getConnection', 'getMainTable', 'getTable']) + ->getMockForAbstractClass(); + $this->resource->expects($this->any())->method('getConnection')->willReturn($this->connection); + $this->resource->expects($this->any())->method('getMainTable')->willReturn('table_test'); + $this->resource->expects($this->any())->method('getTable')->willReturn('test'); + + $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + } +} diff --git a/app/code/Magento/Cms/Test/Unit/Model/Resource/Block/CollectionTest.php b/app/code/Magento/Cms/Test/Unit/Model/Resource/Block/CollectionTest.php new file mode 100644 index 0000000000000..b87c29ca44249 --- /dev/null +++ b/app/code/Magento/Cms/Test/Unit/Model/Resource/Block/CollectionTest.php @@ -0,0 +1,63 @@ +collection = $this->objectManager->getObject( + 'Magento\Cms\Model\Resource\Block\Collection', + [ + 'resource' => $this->resource, + 'connection' => $this->connection + ] + ); + } + + public function testAddFieldToFilterStore() + { + $storeId = 1; + + $expectedFilter = new DataObject( + [ + 'field' => 'store', + 'value' => ['in' => [1]], + 'type' => 'public' + ] + ); + + $this->assertSame($this->collection, $this->collection->addFieldToFilter('store_id', $storeId)); + // addition call to make sure that correct value was set to filter + $this->assertEquals($expectedFilter, $this->collection->getFilter('store')); + } + + public function testAddFieldToFilter() + { + $field = 'title'; + $value = 'test_filter'; + $searchSql = 'sql query'; + + $this->connection->expects($this->any())->method('quoteIdentifier')->willReturn($searchSql); + $this->connection->expects($this->any())->method('prepareSqlCondition')->willReturn($searchSql); + + $this->select->expects($this->once()) + ->method('where') + ->with($searchSql, null, \Magento\Framework\DB\Select::TYPE_CONDITION); + + $this->assertSame($this->collection, $this->collection->addFieldToFilter($field, $value)); + } +} diff --git a/app/code/Magento/Cms/Test/Unit/Model/Resource/Block/Grid/CollectionTest.php b/app/code/Magento/Cms/Test/Unit/Model/Resource/Block/Grid/CollectionTest.php deleted file mode 100644 index c320124de3624..0000000000000 --- a/app/code/Magento/Cms/Test/Unit/Model/Resource/Block/Grid/CollectionTest.php +++ /dev/null @@ -1,89 +0,0 @@ -select = $this->getMockBuilder('Magento\Framework\DB\Select') - ->disableOriginalConstructor() - ->getMock(); - - $connection = $this->getMockBuilder('Magento\Framework\DB\Adapter\Pdo\Mysql') - ->disableOriginalConstructor() - ->getMock(); - $connection->expects($this->any()) - ->method('select') - ->will($this->returnValue($this->select)); - - $resource = $this->getMockBuilder('Magento\Framework\Model\Resource\Db\AbstractDb') - ->disableOriginalConstructor() - ->setMethods(['__wakeup', 'getConnection']) - ->getMockForAbstractClass(); - $resource->expects($this->any()) - ->method('getConnection') - ->will($this->returnValue($connection)); - - $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $arguments = $objectManagerHelper->getConstructArguments( - 'Magento\Cms\Model\Resource\Block\Collection', - ['resource' => $resource, 'connection' => $connection] - ); - - $this->collection = $this->getMockBuilder('Magento\Cms\Model\Resource\Block\Collection') - ->setConstructorArgs($arguments) - ->setMethods(['addFilter', '_translateCondition', 'getMainTable']) - ->getMock(); - } - - public function testAddFieldToFilterSore() - { - $storeId = 1; - $this->collection->expects($this->once()) - ->method('addFilter') - ->with( - $this->equalTo('store'), - $this->equalTo(['in' => [$storeId]]), - $this->equalTo('public') - ); - $this->collection->addFieldToFilter('store_id', $storeId); - } - - public function testAddFieldToFilter() - { - $field = 'title'; - $value = 'test_filter'; - $searchSql = 'sql query'; - - $this->collection->expects($this->once()) - ->method('_translateCondition') - ->with($field, $value) - ->will($this->returnValue($searchSql)); - - $this->select->expects($this->once()) - ->method('where') - ->with( - $this->equalTo($searchSql), - $this->equalTo(null), - $this->equalTo(\Magento\Framework\DB\Select::TYPE_CONDITION) - ); - - $this->collection->addFieldToFilter($field, $value); - } -} diff --git a/app/code/Magento/Cms/Test/Unit/Model/Resource/Page/CollectionTest.php b/app/code/Magento/Cms/Test/Unit/Model/Resource/Page/CollectionTest.php new file mode 100644 index 0000000000000..3ed7babaf1062 --- /dev/null +++ b/app/code/Magento/Cms/Test/Unit/Model/Resource/Page/CollectionTest.php @@ -0,0 +1,63 @@ +collection = $this->objectManager->getObject( + 'Magento\Cms\Model\Resource\Page\Collection', + [ + 'resource' => $this->resource, + 'connection' => $this->connection + ] + ); + } + + public function testAddFieldToFilterStore() + { + $storeId = 1; + + $expectedFilter = new DataObject( + [ + 'field' => 'store', + 'value' => ['in' => [1]], + 'type' => 'public' + ] + ); + + $this->assertSame($this->collection, $this->collection->addFieldToFilter('store_id', $storeId)); + // addition call to make sure that correct value was set to filter + $this->assertEquals($expectedFilter, $this->collection->getFilter('store')); + } + + public function testAddFieldToFilter() + { + $field = 'title'; + $value = 'test_filter'; + $searchSql = 'sql query'; + + $this->connection->expects($this->any())->method('quoteIdentifier')->willReturn($searchSql); + $this->connection->expects($this->any())->method('prepareSqlCondition')->willReturn($searchSql); + + $this->select->expects($this->once()) + ->method('where') + ->with($searchSql, null, \Magento\Framework\DB\Select::TYPE_CONDITION); + + $this->assertSame($this->collection, $this->collection->addFieldToFilter($field, $value)); + } +} diff --git a/app/code/Magento/Cms/Test/Unit/Ui/Component/Listing/Column/Cms/OptionsTest.php b/app/code/Magento/Cms/Test/Unit/Ui/Component/Listing/Column/Cms/OptionsTest.php new file mode 100644 index 0000000000000..37e2e54c25c16 --- /dev/null +++ b/app/code/Magento/Cms/Test/Unit/Ui/Component/Listing/Column/Cms/OptionsTest.php @@ -0,0 +1,123 @@ +systemStoreMock = $this->getMockBuilder('Magento\Store\Model\System\Store') + ->disableOriginalConstructor() + ->getMock(); + + $this->websiteMock = $this->getMock( + 'Magento\Store\Model\Website', + ['getId', 'getName'], + [], + '', + false + ); + + $this->groupMock = $this->getMock('Magento\Store\Model\Group', [], [], '', false); + + $this->storeMock = $this->getMock('Magento\Store\Model\Store', [], [], '', false); + + $this->escaperMock = $this->getMock('Magento\Framework\Escaper', [], [], '', false); + + $this->options = $objectManager->getObject( + 'Magento\Cms\Ui\Component\Listing\Column\Cms\Options', + [ + 'systemStore' => $this->systemStoreMock, + 'escaper' => $this->escaperMock + ] + ); + } + + public function testToOptionArray() + { + $websiteCollection = [$this->websiteMock]; + $groupCollection = [$this->groupMock]; + $storeCollection = [$this->storeMock]; + + $expectedOptions = [ + [ + 'label' => __('All Store Views'), + 'value' => '0' + ], + [ + 'label' => 'Main Website', + 'value' => [ + [ + 'label' => ' Main Website Store', + 'value' => [ + [ + 'label' => ' Default Store View', + 'value' => '1' + ] + ] + ] + ] + ] + ]; + + $this->systemStoreMock->expects($this->once())->method('getWebsiteCollection')->willReturn($websiteCollection); + $this->systemStoreMock->expects($this->once())->method('getGroupCollection')->willReturn($groupCollection); + $this->systemStoreMock->expects($this->once())->method('getStoreCollection')->willReturn($storeCollection); + + $this->websiteMock->expects($this->atLeastOnce())->method('getId')->willReturn('1'); + $this->websiteMock->expects($this->any())->method('getName')->willReturn('Main Website'); + + $this->groupMock->expects($this->atLeastOnce())->method('getWebsiteId')->willReturn('1'); + $this->groupMock->expects($this->atLeastOnce())->method('getId')->willReturn('1'); + $this->groupMock->expects($this->atLeastOnce())->method('getName')->willReturn('Main Website Store'); + + $this->storeMock->expects($this->atLeastOnce())->method('getGroupId')->willReturn('1'); + $this->storeMock->expects($this->atLeastOnce())->method('getName')->willReturn('Default Store View'); + $this->storeMock->expects($this->atLeastOnce())->method('getId')->willReturn('1'); + + $this->escaperMock->expects($this->atLeastOnce())->method('escapeHtml')->willReturnMap( + [ + ['Default Store View', null, 'Default Store View'], + ['Main Website Store', null, 'Main Website Store'], + ['Main Website', null, 'Main Website'] + ] + ); + + $this->assertEquals($expectedOptions, $this->options->toOptionArray()); + } +} diff --git a/app/code/Magento/Cms/Ui/Component/Listing/Column/Cms/Options.php b/app/code/Magento/Cms/Ui/Component/Listing/Column/Cms/Options.php new file mode 100644 index 0000000000000..f94376305c255 --- /dev/null +++ b/app/code/Magento/Cms/Ui/Component/Listing/Column/Cms/Options.php @@ -0,0 +1,40 @@ +options !== null) { + return $this->options; + } + + $this->currentOptions['All Store Views']['label'] = __('All Store Views'); + $this->currentOptions['All Store Views']['value'] = self::ALL_STORE_VIEWS; + + $this->generateCurrentOptions(); + + $this->options = array_values($this->currentOptions); + + return $this->options; + } +} diff --git a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_listing.xml b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_listing.xml index c1e9dad73c743..ff1d8285d9c23 100644 --- a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_listing.xml +++ b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_listing.xml @@ -147,7 +147,7 @@ - Magento\Store\Ui\Component\Listing\Column\Store\Options + Magento\Cms\Ui\Component\Listing\Column\Cms\Options @@ -370,9 +370,10 @@ - Magento_Ui/js/grid/columns/select + Magento_Ui/js/grid/columns/column + ui/grid/cells/html false text left diff --git a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_listing.xml b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_listing.xml index 7c027f465769f..230203c34299a 100644 --- a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_listing.xml +++ b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_listing.xml @@ -159,7 +159,7 @@ - Magento\Store\Ui\Component\Listing\Column\Store\Options + Magento\Cms\Ui\Component\Listing\Column\Cms\Options diff --git a/app/code/Magento/CmsUrlRewrite/etc/setup/events.xml b/app/code/Magento/CmsUrlRewrite/etc/setup/events.xml new file mode 100644 index 0000000000000..5403719ab7318 --- /dev/null +++ b/app/code/Magento/CmsUrlRewrite/etc/setup/events.xml @@ -0,0 +1,12 @@ + + + + + + + diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_attribute_edit_product_tab_variations_popup.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_attribute_edit_product_tab_variations_popup.xml old mode 100644 new mode 100755 index 5f979c8085927..8ffec72e74e4a --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_attribute_edit_product_tab_variations_popup.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_attribute_edit_product_tab_variations_popup.xml @@ -5,6 +5,6 @@ * See COPYING.txt for license details. */ --> - + diff --git a/app/code/Magento/Deploy/Console/Command/SetModeCommand.php b/app/code/Magento/Deploy/Console/Command/SetModeCommand.php new file mode 100644 index 0000000000000..0d6e790c593cc --- /dev/null +++ b/app/code/Magento/Deploy/Console/Command/SetModeCommand.php @@ -0,0 +1,115 @@ +objectManager = $objectManager; + parent::__construct(); + } + + /** + * {@inheritdoc} + */ + protected function configure() + { + $description = 'Displays current application mode.'; + + $this->setName('deploy:mode:set') + ->setDescription($description) + ->setDefinition([ + new InputArgument( + self::MODE_ARGUMENT, + InputArgument::REQUIRED, + 'The application mode to set. Available options are "developer" or "production"' + ), + new InputOption( + self::SKIP_COMPILATION_OPTION, + 's', + InputOption::VALUE_NONE, + 'Skips the clearing and regeneration of static content (generated code, preprocessed CSS, ' + . 'and assets in pub/static/)' + ) + ]); + parent::configure(); + } + + /** + * {@inheritdoc} + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + try { + /** @var \Magento\Deploy\Model\Mode $modeController */ + $modeController = $this->objectManager->create( + 'Magento\Deploy\Model\Mode', + [ + 'input' => $input, + 'output' => $output, + ] + ); + $toMode = $input->getArgument(self::MODE_ARGUMENT); + $skipCompilation = $input->getOption(self::SKIP_COMPILATION_OPTION); + switch($toMode) { + case State::MODE_DEVELOPER: + $modeController->enableDeveloperMode(); + break; + case State::MODE_PRODUCTION: + if ($skipCompilation) { + $modeController->enableProductionModeMinimal(); + } else { + $modeController->enableProductionMode(); + } + break; + default: + throw new LocalizedException(__('Cannot switch into given mode "%1"', $toMode)); + } + $output->writeln('Enabled ' . $toMode . ' mode.'); + } catch (\Exception $e) { + $output->writeln('' . $e->getMessage() . ''); + if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) { + $output->writeln($e->getTraceAsString()); + } + return; + } + } +} diff --git a/app/code/Magento/Deploy/Console/Command/ShowModeCommand.php b/app/code/Magento/Deploy/Console/Command/ShowModeCommand.php new file mode 100644 index 0000000000000..b9bfddf5f0b03 --- /dev/null +++ b/app/code/Magento/Deploy/Console/Command/ShowModeCommand.php @@ -0,0 +1,74 @@ +objectManager = $objectManager; + parent::__construct(); + } + + /** + * {@inheritdoc} + */ + protected function configure() + { + $description = 'Displays current application mode.'; + + $this->setName('deploy:mode:show')->setDescription($description); + parent::configure(); + } + + /** + * {@inheritdoc} + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + try { + /** @var \Magento\Deploy\Model\Mode $mode */ + $mode = $this->objectManager->create( + 'Magento\Deploy\Model\Mode', + [ + 'input' => $input, + 'output' => $output, + ] + ); + $currentMode = $mode->getMode() ?: State::MODE_DEFAULT; + $output->writeln("Current application mode: $currentMode."); + } catch (\Exception $e) { + $output->writeln('' . $e->getMessage() . ''); + if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) { + $output->writeln($e->getTraceAsString()); + } + return; + } + } +} diff --git a/app/code/Magento/Deploy/LICENSE.txt b/app/code/Magento/Deploy/LICENSE.txt new file mode 100644 index 0000000000000..49525fd99da9c --- /dev/null +++ b/app/code/Magento/Deploy/LICENSE.txt @@ -0,0 +1,48 @@ + +Open Software License ("OSL") v. 3.0 + +This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work: + +Licensed under the Open Software License version 3.0 + + 1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following: + + 1. to reproduce the Original Work in copies, either alone or as part of a collective work; + + 2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work; + + 3. to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License; + + 4. to perform the Original Work publicly; and + + 5. to display the Original Work publicly. + + 2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works. + + 3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work. + + 4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license. + + 5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c). + + 6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work. + + 7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer. + + 8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation. + + 9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including 'fair use' or 'fair dealing'). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c). + + 10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware. + + 11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License. + + 12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License. + + 13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. + + 14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + 15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. + + 16. Modification of This License. This License is Copyright (C) 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under " or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process. \ No newline at end of file diff --git a/app/code/Magento/Deploy/LICENSE_AFL.txt b/app/code/Magento/Deploy/LICENSE_AFL.txt new file mode 100644 index 0000000000000..87943b95d43a5 --- /dev/null +++ b/app/code/Magento/Deploy/LICENSE_AFL.txt @@ -0,0 +1,48 @@ + +Academic Free License ("AFL") v. 3.0 + +This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work: + +Licensed under the Academic Free License version 3.0 + + 1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following: + + 1. to reproduce the Original Work in copies, either alone or as part of a collective work; + + 2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work; + + 3. to distribute or communicate copies of the Original Work and Derivative Works to the public, under any license of your choice that does not contradict the terms and conditions, including Licensor's reserved rights and remedies, in this Academic Free License; + + 4. to perform the Original Work publicly; and + + 5. to display the Original Work publicly. + + 2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works. + + 3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work. + + 4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license. + + 5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c). + + 6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work. + + 7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer. + + 8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation. + + 9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c). + + 10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware. + + 11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License. + + 12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License. + + 13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. + + 14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + 15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. + + 16. Modification of This License. This License is Copyright 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Academic Free License" or "AFL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under " or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process. \ No newline at end of file diff --git a/app/code/Magento/Deploy/Model/Mode.php b/app/code/Magento/Deploy/Model/Mode.php new file mode 100644 index 0000000000000..38fecde0b480c --- /dev/null +++ b/app/code/Magento/Deploy/Model/Mode.php @@ -0,0 +1,372 @@ +input = $input; + $this->output = $output; + $this->writer = $writer; + $this->reader = $reader; + $this->objectManager = $objectManager; + $this->filesystem = $filesystem; + $this->directoryList = $directoryList; + $this->driverFile = $driverFile; + $this->storeView = $storeView; + $this->shell = $shell; + $this->maintenanceMode = $maintenanceMode; + $this->functionCallPath = 'php -f ' . BP . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . 'magento '; + } + + /** + * Enable production mode + * + * @return void + */ + public function enableProductionMode() + { + $this->enableMaintenanceMode($this->output); + // Сlean up /var/generation, /var/di/, /var/view_preprocessed and /pub/static directories + $this->cleanupFilesystem( + [ + DirectoryList::CACHE, + DirectoryList::GENERATION, + DirectoryList::DI, + DirectoryList::TMP_MATERIALIZATION_DIR, + DirectoryList::STATIC_VIEW, + ] + ); + // Trigger static assets compilation and deployment + $this->deployStaticContent($this->output); + $this->deployCss($this->output); + // Trigger code generation + $this->compile($this->output); + $this->disableMaintenanceMode($this->output); + $this->lockStaticResources(); + $this->setStoreMode(State::MODE_PRODUCTION); + } + + /** + * Only lock static resource locations and set store mode, without handling static content + * + * @return void + */ + public function enableProductionModeMinimal() + { + $this->lockStaticResources(); + $this->setStoreMode(State::MODE_PRODUCTION); + } + + /** + * Enable Developer mode + * + * @return void + */ + public function enableDeveloperMode() + { + $this->cleanupFilesystem( + [ + DirectoryList::CACHE, + DirectoryList::GENERATION, + DirectoryList::DI, + DirectoryList::TMP_MATERIALIZATION_DIR, + DirectoryList::STATIC_VIEW, + ] + ); + $this->setStoreMode(State::MODE_DEVELOPER); + } + + /** + * Get current mode information + * + * @return string + * @throws \Exception + */ + public function getMode() + { + $env = $this->reader->load(ConfigFilePool::APP_ENV); + return isset($env[State::PARAM_MODE]) ? $env[State::PARAM_MODE] : null; + } + + /** + * Store mode in env.php + * + * @param string $mode + * @return void + */ + protected function setStoreMode($mode) + { + $data = [ + ConfigFilePool::APP_ENV => [ + State::PARAM_MODE => $mode + ] + ]; + $this->writer->saveConfig($data); + } + + /** + * Enable maintenance mode + * + * @param OutputInterface $output + * @return void + */ + protected function enableMaintenanceMode(OutputInterface $output) + { + $this->maintenanceMode->set(true); + $output->writeln('Enabled maintenance mode'); + } + + /** + * Disable maintenance mode + * + * @param OutputInterface $output + * @return void + */ + protected function disableMaintenanceMode(OutputInterface $output) + { + $this->maintenanceMode->set(false); + $output->writeln('Disabled maintenance mode'); + } + + /** + * Deploy CSS + * + * @param OutputInterface $output + * @return void + */ + private function deployCss(OutputInterface $output) + { + $themeLocalePairs = $this->storeView->retrieveThemeLocalePairs(); + foreach ($themeLocalePairs as $themeLocalePair) { + $theme = $themeLocalePair['theme'] ?: self::DEFAULT_THEME; + $cmd = $this->functionCallPath . 'dev:css:deploy less' + . ' --' . CssDeployCommand::THEME_OPTION . '="' . $theme . '"' + . ' --' . CssDeployCommand::LOCALE_OPTION . '="' . $themeLocalePair['locale'] . '"'; + + /** + * @todo build a solution that does not depend on exec + */ + $execOutput = $this->shell->execute($cmd); + $output->writeln($execOutput); + } + $output->writeln('CSS deployment complete'); + } + + /** + * Deploy static content + * + * @param OutputInterface $output + * @return void + * @throws \Exception + */ + private function deployStaticContent(OutputInterface $output) + { + $cmd = $this->functionCallPath . 'setup:static-content:deploy ' + . implode(' ', $this->storeView->retrieveLocales()); + + /** + * @todo build a solution that does not depend on exec + */ + $execOutput = $this->shell->execute($cmd); + $output->writeln($execOutput); + $output->writeln('Static content deployment complete'); + } + + /** + * Runs code multi-tenant compiler to generate code and DI information + * + * @param OutputInterface $output + * @return void + */ + private function compile(OutputInterface $output) + { + $this->cleanupFilesystem( + [ + DirectoryList::CACHE, + DirectoryList::GENERATION, + DirectoryList::DI, + ] + ); + $cmd = $this->functionCallPath . 'setup:di:compile-multi-tenant'; + + /** + * exec command is necessary for now to isolate the autoloaders in the compiler from the memory state + * of this process, which would prevent some classes from being generated + * + * @todo build a solution that does not depend on exec + */ + $execOutput = $this->shell->execute($cmd); + $output->writeln($execOutput); + $output->writeln('Compilation complete'); + } + + /** + * Deletes specified directories by code + * + * @param array $directoryCodeList + * @return void + */ + private function cleanupFilesystem($directoryCodeList) + { + $excludePatterns = ['#.htaccess#', '#deployed_version.txt#']; + foreach ($directoryCodeList as $code) { + if ($code == DirectoryList::STATIC_VIEW) { + $directoryPath = $this->directoryList->getPath(DirectoryList::STATIC_VIEW); + if ($this->driverFile->isExists($directoryPath)) { + $files = $this->driverFile->readDirectory($directoryPath); + foreach ($files as $file) { + foreach ($excludePatterns as $pattern) { + if (preg_match($pattern, $file)) { + continue 2; + } + } + if ($this->driverFile->isFile($file)) { + $this->driverFile->deleteFile($file); + } else { + $this->driverFile->deleteDirectory($file); + } + } + } + } else { + $this->filesystem->getDirectoryWrite($code) + ->delete(); + } + } + } + + /** + * Change permissions for directories by their code + * + * @param array $directoryCodeList + * @param int $dirPermissions + * @param int $filePermissions + * @return void + */ + private function changePermissions($directoryCodeList, $dirPermissions, $filePermissions) + { + foreach ($directoryCodeList as $code) { + $directoryPath = $this->directoryList->getPath($code); + if ($this->driverFile->isExists($directoryPath)) { + $this->filesystem->getDirectoryWrite($code) + ->changePermissionsRecursively('', $dirPermissions, $filePermissions); + } else { + $this->driverFile->createDirectory($directoryPath, $dirPermissions); + } + } + } + + /** + * Chenge permissions on static resources + * + * @return void + */ + private function lockStaticResources() + { + // Lock /var/generation, /var/di/ and /var/view_preprocessed directories + $this->changePermissions( + [ + DirectoryList::GENERATION, + DirectoryList::DI, + DirectoryList::TMP_MATERIALIZATION_DIR, + ], + self::PERMISSIONS_DIR, + self::PERMISSIONS_FILE + ); + } +} diff --git a/app/code/Magento/Deploy/README.md b/app/code/Magento/Deploy/README.md new file mode 100644 index 0000000000000..c263e8a5ee949 --- /dev/null +++ b/app/code/Magento/Deploy/README.md @@ -0,0 +1,8 @@ +Deploy module contains 2 commands that allows switching between application modes (for instance from development to +production) and show current application mode. To change the mode run "bin/magento setup:mode:set [mode]". +Where mode can be one of the following: + - development + - production +When switching to production mode, you can pass optional parameter skip-compilation to do not compile static files, CSS +and do not run the compilation process. + diff --git a/app/code/Magento/Deploy/Test/Unit/Console/Command/SetModeCommandTest.php b/app/code/Magento/Deploy/Test/Unit/Console/Command/SetModeCommandTest.php new file mode 100644 index 0000000000000..58d7fc7efd15e --- /dev/null +++ b/app/code/Magento/Deploy/Test/Unit/Console/Command/SetModeCommandTest.php @@ -0,0 +1,91 @@ +objectManagerMock = $this->getMockForAbstractClass('Magento\Framework\ObjectManagerInterface'); + $this->modeMock = $this->getMock('Magento\Deploy\Model\Mode', [], [], '', false); + + $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $this->command = $objectManager->getObject( + 'Magento\Deploy\Console\Command\SetModeCommand', + ['objectManager' => $this->objectManagerMock] + ); + + $this->objectManagerMock->expects($this->once())->method('create')->willReturn($this->modeMock); + } + + public function testSetProductionMode() + { + $this->modeMock->expects($this->once())->method('enableProductionMode'); + + $tester = new CommandTester($this->command); + $tester->execute(['mode' => 'production']); + $this->assertContains( + "production mode", + $tester->getDisplay() + ); + } + + public function testSetDeveloperMode() + { + $this->modeMock->expects($this->once())->method('enableDeveloperMode'); + + $tester = new CommandTester($this->command); + $tester->execute(['mode' => 'developer']); + $this->assertContains( + "developer mode", + $tester->getDisplay() + ); + } + + public function testSetProductionSkipCompilation() + { + $this->modeMock->expects($this->once())->method('enableProductionModeMinimal'); + + $tester = new CommandTester($this->command); + $tester->execute(['mode' => 'production', '--skip-compilation' => true]); + $this->assertContains( + "production mode", + $tester->getDisplay() + ); + } + + public function testSetInvalidMode() + { + $tester = new CommandTester($this->command); + $tester->execute(['mode' => 'invalid-mode']); + $this->assertContains( + "Cannot switch into given mode", + $tester->getDisplay() + ); + } +} diff --git a/app/code/Magento/Deploy/Test/Unit/Console/Command/ShowModeCommandTest.php b/app/code/Magento/Deploy/Test/Unit/Console/Command/ShowModeCommandTest.php new file mode 100644 index 0000000000000..ea1e99562e1b2 --- /dev/null +++ b/app/code/Magento/Deploy/Test/Unit/Console/Command/ShowModeCommandTest.php @@ -0,0 +1,58 @@ +objectManagerMock = $this->getMockForAbstractClass('Magento\Framework\ObjectManagerInterface'); + $this->modeMock = $this->getMock('Magento\Deploy\Model\Mode', [], [], '', false); + + $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $this->command = $objectManager->getObject( + 'Magento\Deploy\Console\Command\ShowModeCommand', + ['objectManager' => $this->objectManagerMock] + ); + + $this->objectManagerMock->expects($this->once())->method('create')->willReturn($this->modeMock); + } + + public function testExecute() + { + $currentMode = 'application-mode'; + $this->modeMock->expects($this->once())->method('getMode')->willReturn($currentMode); + + $tester = new CommandTester($this->command); + $tester->execute([]); + $this->assertContains( + $currentMode, + $tester->getDisplay() + ); + } +} diff --git a/app/code/Magento/Deploy/composer.json b/app/code/Magento/Deploy/composer.json new file mode 100644 index 0000000000000..796a530b9fa20 --- /dev/null +++ b/app/code/Magento/Deploy/composer.json @@ -0,0 +1,25 @@ +{ + "name": "magento/module-deploy", + "description": "N/A", + "require": { + "php": "~5.5.0|~5.6.0", + "magento/framework": "1.0.0-beta", + "magento/magento-composer-installer": "*", + "magento/module-developer": "1.0.0-beta", + "magento/module-store": "1.0.0-beta" + }, + "type": "magento2-module", + "version": "1.0.0-beta", + "license": [ + "OSL-3.0", + "AFL-3.0" + ], + "extra": { + "map": [ + [ + "*", + "Magento/Deploy" + ] + ] + } +} diff --git a/app/code/Magento/Deploy/etc/di.xml b/app/code/Magento/Deploy/etc/di.xml new file mode 100644 index 0000000000000..d9dc3ba171138 --- /dev/null +++ b/app/code/Magento/Deploy/etc/di.xml @@ -0,0 +1,17 @@ + + + + + + + Magento\Deploy\Console\Command\SetModeCommand + Magento\Deploy\Console\Command\ShowModeCommand + + + + diff --git a/app/code/Magento/Deploy/etc/module.xml b/app/code/Magento/Deploy/etc/module.xml new file mode 100644 index 0000000000000..c44117227dcd3 --- /dev/null +++ b/app/code/Magento/Deploy/etc/module.xml @@ -0,0 +1,14 @@ + + + + + + + + + diff --git a/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_files_index.xml b/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_files_index.xml index 047a056d28d84..aab19bee1d1ae 100644 --- a/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_files_index.xml +++ b/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_files_index.xml @@ -7,7 +7,7 @@ --> - + diff --git a/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_launch.xml b/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_launch.xml index a9f502b6433b2..e39ca884c8c3f 100644 --- a/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_launch.xml +++ b/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_launch.xml @@ -13,7 +13,7 @@ - + diff --git a/app/code/Magento/Developer/Console/Command/CssDeployCommand.php b/app/code/Magento/Developer/Console/Command/CssDeployCommand.php index 05bbd689d9be6..27f5c8658ca02 100644 --- a/app/code/Magento/Developer/Console/Command/CssDeployCommand.php +++ b/app/code/Magento/Developer/Console/Command/CssDeployCommand.php @@ -226,7 +226,8 @@ protected function execute(InputInterface $input, OutputInterface $output) [ 'asset' => $asset, 'origContent' => $content, - 'origContentType' => $asset->getContentType() + 'origContentType' => $asset->getContentType(), + 'origAssetPath' => $asset->getFilePath() ] ); diff --git a/app/code/Magento/Eav/Model/Entity/AbstractEntity.php b/app/code/Magento/Eav/Model/Entity/AbstractEntity.php index 9e0415b9858e5..574a73dbfa352 100644 --- a/app/code/Magento/Eav/Model/Entity/AbstractEntity.php +++ b/app/code/Magento/Eav/Model/Entity/AbstractEntity.php @@ -1262,6 +1262,7 @@ protected function _collectSaveData($newObject) if (!$attribute->isInSet($newObject->getAttributeSetId()) && !in_array($k, $staticFields)) { $this->_aggregateDeleteData($delete, $attribute, $newObject); + continue; } $attrId = $attribute->getAttributeId(); diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/AbstractEntityTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/AbstractEntityTest.php index 28c5f3c742393..2cb9a8951fcfb 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/AbstractEntityTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/AbstractEntityTest.php @@ -239,7 +239,6 @@ public function testSave($attributeCode, $attributeSetId, $productData, $product 'getAffectedFields', 'isStatic', 'getEntityValueId', - 'getEntityIdField' ] ); @@ -255,14 +254,6 @@ public function testSave($attributeCode, $attributeSetId, $productData, $product $backendModel->expects($this->never())->method('getEntityValueId'); - $backendModel->expects( - isset($productData['entity_id']) ? $this->never() : $this->once() - )->method( - 'getEntityIdField' - )->will( - $this->returnValue('entity_id') - ); - $backendModel->setAttribute($attribute); $attribute->expects($this->any())->method('getBackend')->will($this->returnValue($backendModel)); $attribute->setId(222); diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/VersionControl/AbstractEntityTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/VersionControl/AbstractEntityTest.php index a04caf7cdc878..70467e503d08f 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/VersionControl/AbstractEntityTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/VersionControl/AbstractEntityTest.php @@ -88,7 +88,6 @@ public function testSave($attributeCode, $attributeSetId, $productData, $product 'getAffectedFields', 'isStatic', 'getEntityValueId', - 'getEntityIdField' ] ); @@ -102,14 +101,6 @@ public function testSave($attributeCode, $attributeSetId, $productData, $product $backendModel->expects($this->any())->method('isStatic')->will($this->returnValue(false)); $backendModel->expects($this->never())->method('getEntityValueId'); - $backendModel->expects( - isset($productData['entity_id']) ? $this->never() : $this->once() - )->method( - 'getEntityIdField' - )->will( - $this->returnValue('entity_id') - ); - $backendModel->setAttribute($attribute); $attribute->expects($this->any())->method('getBackend')->will($this->returnValue($backendModel)); diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_view_type_grouped.xml b/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_view_type_grouped.xml index d8ba9118949b9..1cfe367c7d69c 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_view_type_grouped.xml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/layout/catalog_product_view_type_grouped.xml @@ -10,6 +10,6 @@ - + diff --git a/app/code/Magento/Integration/Api/AdminTokenServiceInterface.php b/app/code/Magento/Integration/Api/AdminTokenServiceInterface.php index 3c2999851a9db..02e2c85d8b34c 100644 --- a/app/code/Magento/Integration/Api/AdminTokenServiceInterface.php +++ b/app/code/Magento/Integration/Api/AdminTokenServiceInterface.php @@ -6,10 +6,6 @@ namespace Magento\Integration\Api; -use Magento\Framework\Exception\AuthenticationException; -use Magento\Framework\Exception\InputException; -use Magento\Framework\Exception\LocalizedException; - /** * Interface providing token generation for Admins * @@ -23,9 +19,9 @@ interface AdminTokenServiceInterface * @param string $username * @param string $password * @return string Token created - * @throws InputException For invalid input - * @throws AuthenticationException - * @throws LocalizedException + * @throws \Magento\Framework\Exception\InputException For invalid input + * @throws \Magento\Framework\Exception\AuthenticationException + * @throws \Magento\Framework\Exception\LocalizedException */ public function createAdminAccessToken($username, $password); diff --git a/app/code/Magento/Integration/Api/CustomerTokenServiceInterface.php b/app/code/Magento/Integration/Api/CustomerTokenServiceInterface.php index 245d39bc4a63e..218a6f0d4acba 100644 --- a/app/code/Magento/Integration/Api/CustomerTokenServiceInterface.php +++ b/app/code/Magento/Integration/Api/CustomerTokenServiceInterface.php @@ -6,8 +6,6 @@ namespace Magento\Integration\Api; -use Magento\Framework\Exception\AuthenticationException; - /** * Interface providing token generation for Customers * @@ -21,7 +19,7 @@ interface CustomerTokenServiceInterface * @param string $username * @param string $password * @return string Token created - * @throws AuthenticationException + * @throws \Magento\Framework\Exception\AuthenticationException */ public function createCustomerAccessToken($username, $password); diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_preview.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_preview.xml index cb7ac6cb26d42..f4b996bcaa12d 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_preview.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_preview.xml @@ -9,7 +9,7 @@ - + diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_preview.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_preview.xml index d468c2a843414..5d6173d564e20 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_preview.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_preview.xml @@ -9,7 +9,7 @@ - + diff --git a/app/code/Magento/Newsletter/view/frontend/layout/customer_account.xml b/app/code/Magento/Newsletter/view/frontend/layout/customer_account.xml index b2c17400a81e5..e009e753a8bd0 100644 --- a/app/code/Magento/Newsletter/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Newsletter/view/frontend/layout/customer_account.xml @@ -15,6 +15,5 @@ - diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_ordersgrid.xml b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_ordersgrid.xml index 2798a934f1915..78e295bb5557f 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_ordersgrid.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_ordersgrid.xml @@ -15,8 +15,8 @@ - - + + diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_view.xml b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_view.xml index d1a23150b2983..2ea45b4fc1ffb 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_view.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/paypal_billing_agreement_view.xml @@ -18,8 +18,8 @@ - - + + diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_transaction_child_block.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_transaction_child_block.xml index f6281eb9fd04a..f937a16420e78 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_transaction_child_block.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_transaction_child_block.xml @@ -59,6 +59,6 @@ - + diff --git a/app/code/Magento/Sales/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Sales/view/frontend/layout/checkout_index_index.xml index a9d1349d10f68..a61c83d274f16 100644 --- a/app/code/Magento/Sales/view/frontend/layout/checkout_index_index.xml +++ b/app/code/Magento/Sales/view/frontend/layout/checkout_index_index.xml @@ -7,6 +7,6 @@ --> - + diff --git a/app/code/Magento/Store/Model/Config/StoreView.php b/app/code/Magento/Store/Model/Config/StoreView.php new file mode 100644 index 0000000000000..8b564b5ac5ab0 --- /dev/null +++ b/app/code/Magento/Store/Model/Config/StoreView.php @@ -0,0 +1,112 @@ +scopeConfig = $scopeConfig; + $this->storeManager = $storeManager; + $this->themeProvider = $themeProvider; + } + + /** + * Retrieves a unique list of pairs representing the theme/locale for each store view + * + * @return array + */ + public function retrieveThemeLocalePairs() + { + $stores = $this->storeManager->getStores(); + $localeThemeData = []; + + /** @var \Magento\Store\Api\Data\StoreInterface $store */ + foreach ($stores as $store) { + $code = $store->getCode(); + $themeId = $this->scopeConfig->getValue( + DesignInterface::XML_PATH_THEME_ID, + ScopeInterface::SCOPE_STORE, + $code + ); + $localeThemeData[] = [ + 'theme' => $this->themeProvider->getThemeById($themeId)->getCode(), + 'locale' => $this->scopeConfig->getValue( + Data::XML_PATH_DEFAULT_LOCALE, + ScopeInterface::SCOPE_STORE, + $code + ) + ]; + } + + return $this->removeDuplicates($localeThemeData); + } + + /** + * Retrieves a unique list of locales that are used by store views + * + * @return array + */ + public function retrieveLocales() + { + $stores = $this->storeManager->getStores(); + $locales = []; + + /** @var \Magento\Store\Api\Data\StoreInterface $store */ + foreach ($stores as $store) { + $locales[] = $this->scopeConfig->getValue( + Data::XML_PATH_DEFAULT_LOCALE, + ScopeInterface::SCOPE_STORE, + $store->getCode() + ); + } + + return $this->removeDuplicates($locales); + } + + /** + * Remove duplicate entries in an array + * + * @param array $arr + * @return array + */ + private function removeDuplicates($arr) + { + $len = count($arr); + for ($out = 0; $out < $len; $out++) { + $outVal = $arr[$out]; + for ($in = $out + 1; $in < $len; $in++) { + $inVal = $arr[$in]; + if ($outVal === $inVal) { + unset($arr[$out]); + } + } + } + return $arr; + } +} diff --git a/app/code/Magento/Store/Ui/Component/Listing/Column/Store/Options.php b/app/code/Magento/Store/Ui/Component/Listing/Column/Store/Options.php index 4cbef52f9fc6c..d55c1f620f007 100644 --- a/app/code/Magento/Store/Ui/Component/Listing/Column/Store/Options.php +++ b/app/code/Magento/Store/Ui/Component/Listing/Column/Store/Options.php @@ -33,6 +33,11 @@ class Options implements OptionSourceInterface */ protected $options; + /** + * @var array + */ + protected $currentOptions = []; + /** * Constructor * @@ -55,11 +60,24 @@ public function toOptionArray() if ($this->options !== null) { return $this->options; } + + $this->generateCurrentOptions(); + + $this->options = array_values($this->currentOptions); + + return $this->options; + } + + /** + * Generate current options + * + * @return void + */ + protected function generateCurrentOptions() + { $websiteCollection = $this->systemStore->getWebsiteCollection(); $groupCollection = $this->systemStore->getGroupCollection(); $storeCollection = $this->systemStore->getStoreCollection(); - - $currentOptions = []; /** @var \Magento\Store\Model\Website $website */ foreach ($websiteCollection as $website) { $groups = []; @@ -84,12 +102,9 @@ public function toOptionArray() } if (!empty($groups)) { $name = $this->escaper->escapeHtml($website->getName()); - $currentOptions[$name]['label'] = $name; - $currentOptions[$name]['value'] = array_values($groups); + $this->currentOptions[$name]['label'] = $name; + $this->currentOptions[$name]['value'] = array_values($groups); } } - $this->options = array_values($currentOptions); - - return $this->options; } } diff --git a/app/code/Magento/Swagger/Controller/Index/Index.php b/app/code/Magento/Swagger/Controller/Index/Index.php new file mode 100644 index 0000000000000..b898836ccf37d --- /dev/null +++ b/app/code/Magento/Swagger/Controller/Index/Index.php @@ -0,0 +1,43 @@ +pageConfig = $pageConfig; + $this->pageFactory = $pageFactory; + } + + /** + * @return \Magento\Framework\View\Result\Page + */ + public function execute() + { + $this->pageConfig->addBodyClass('swagger-section'); + return $this->pageFactory->create(); + } +} diff --git a/app/code/Magento/Swagger/LICENSE.txt b/app/code/Magento/Swagger/LICENSE.txt new file mode 100644 index 0000000000000..49525fd99da9c --- /dev/null +++ b/app/code/Magento/Swagger/LICENSE.txt @@ -0,0 +1,48 @@ + +Open Software License ("OSL") v. 3.0 + +This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work: + +Licensed under the Open Software License version 3.0 + + 1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following: + + 1. to reproduce the Original Work in copies, either alone or as part of a collective work; + + 2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work; + + 3. to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License; + + 4. to perform the Original Work publicly; and + + 5. to display the Original Work publicly. + + 2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works. + + 3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work. + + 4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license. + + 5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c). + + 6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work. + + 7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer. + + 8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation. + + 9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including 'fair use' or 'fair dealing'). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c). + + 10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware. + + 11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License. + + 12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License. + + 13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. + + 14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + 15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. + + 16. Modification of This License. This License is Copyright (C) 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under " or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process. \ No newline at end of file diff --git a/app/code/Magento/Swagger/LICENSE_AFL.txt b/app/code/Magento/Swagger/LICENSE_AFL.txt new file mode 100644 index 0000000000000..87943b95d43a5 --- /dev/null +++ b/app/code/Magento/Swagger/LICENSE_AFL.txt @@ -0,0 +1,48 @@ + +Academic Free License ("AFL") v. 3.0 + +This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work: + +Licensed under the Academic Free License version 3.0 + + 1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following: + + 1. to reproduce the Original Work in copies, either alone or as part of a collective work; + + 2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work; + + 3. to distribute or communicate copies of the Original Work and Derivative Works to the public, under any license of your choice that does not contradict the terms and conditions, including Licensor's reserved rights and remedies, in this Academic Free License; + + 4. to perform the Original Work publicly; and + + 5. to display the Original Work publicly. + + 2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works. + + 3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work. + + 4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license. + + 5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c). + + 6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work. + + 7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer. + + 8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation. + + 9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c). + + 10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware. + + 11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License. + + 12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License. + + 13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. + + 14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + 15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. + + 16. Modification of This License. This License is Copyright 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Academic Free License" or "AFL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under " or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process. \ No newline at end of file diff --git a/app/code/Magento/Swagger/README.md b/app/code/Magento/Swagger/README.md new file mode 100644 index 0000000000000..e2ab6d10fdf2d --- /dev/null +++ b/app/code/Magento/Swagger/README.md @@ -0,0 +1,3 @@ +The Magento_Swagger module provides access to a page generated using the swagger-ui package. The swagger-ui can be viewed +[on Github](https://github.com/swagger-api/swagger-ui). It accesses the JSON Schema describing Magento's REST APIs, +and displays it in a user-friendly, navigable format. diff --git a/app/code/Magento/Swagger/Test/Unit/Controller/Index/IndexTest.php b/app/code/Magento/Swagger/Test/Unit/Controller/Index/IndexTest.php new file mode 100644 index 0000000000000..0143601c8995d --- /dev/null +++ b/app/code/Magento/Swagger/Test/Unit/Controller/Index/IndexTest.php @@ -0,0 +1,34 @@ +getMockBuilder('Magento\Framework\View\Page\Config') + ->disableOriginalConstructor() + ->getMock(); + $resultPageFactory = $this->getMockBuilder('Magento\Framework\View\Result\PageFactory') + ->disableOriginalConstructor() + ->getMock(); + + $pageConfigMock->expects($this->once())->method('addBodyClass')->with('swagger-section'); + $resultPageFactory->expects($this->once())->method('create'); + + $model = $objectManager->getObject( + 'Magento\Swagger\Controller\Index\Index', + [ + 'pageConfig' => $pageConfigMock, + 'pageFactory' => $resultPageFactory + ] + ); + $model->execute(); + } +} diff --git a/app/code/Magento/Swagger/composer.json b/app/code/Magento/Swagger/composer.json new file mode 100644 index 0000000000000..1e0f8840199d4 --- /dev/null +++ b/app/code/Magento/Swagger/composer.json @@ -0,0 +1,23 @@ +{ + "name": "magento/module-swagger", + "description": "N/A", + "require": { + "php": "~5.5.0|~5.6.0", + "magento/framework": "1.0.0-beta", + "magento/magento-composer-installer": "*" + }, + "type": "magento2-module", + "version": "1.0.0-beta", + "license": [ + "OSL-3.0", + "AFL-3.0" + ], + "extra": { + "map": [ + [ + "*", + "Magento/Swagger" + ] + ] + } +} diff --git a/app/code/Magento/Swagger/etc/frontend/routes.xml b/app/code/Magento/Swagger/etc/frontend/routes.xml new file mode 100644 index 0000000000000..02b9256427512 --- /dev/null +++ b/app/code/Magento/Swagger/etc/frontend/routes.xml @@ -0,0 +1,14 @@ + + + + + + + + + diff --git a/app/code/Magento/Swagger/etc/module.xml b/app/code/Magento/Swagger/etc/module.xml new file mode 100644 index 0000000000000..06e6a83b6b213 --- /dev/null +++ b/app/code/Magento/Swagger/etc/module.xml @@ -0,0 +1,10 @@ + + + + + diff --git a/app/code/Magento/Swagger/view/frontend/layout/swagger_index_index.xml b/app/code/Magento/Swagger/view/frontend/layout/swagger_index_index.xml new file mode 100644 index 0000000000000..a43a5c7885a96 --- /dev/null +++ b/app/code/Magento/Swagger/view/frontend/layout/swagger_index_index.xml @@ -0,0 +1,48 @@ + + + + + Swagger UI + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/code/Magento/Swagger/view/frontend/templates/swagger-ui/LICENSE.txt b/app/code/Magento/Swagger/view/frontend/templates/swagger-ui/LICENSE.txt new file mode 100644 index 0000000000000..542991f955026 --- /dev/null +++ b/app/code/Magento/Swagger/view/frontend/templates/swagger-ui/LICENSE.txt @@ -0,0 +1,11 @@ +Copyright 2015 SmartBear Software + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/app/code/Magento/Swagger/view/frontend/templates/swagger-ui/index.phtml b/app/code/Magento/Swagger/view/frontend/templates/swagger-ui/index.phtml new file mode 100644 index 0000000000000..b847b929a25e4 --- /dev/null +++ b/app/code/Magento/Swagger/view/frontend/templates/swagger-ui/index.phtml @@ -0,0 +1,102 @@ +getBaseUrl(), '/') . '/rest/default/schema?services=all'; +?> + + + + + + + +
 
+
diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/LICENSE.txt b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/LICENSE.txt new file mode 100644 index 0000000000000..542991f955026 --- /dev/null +++ b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/LICENSE.txt @@ -0,0 +1,11 @@ +Copyright 2015 SmartBear Software + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/css/print.css b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/css/print.css new file mode 100644 index 0000000000000..cd3aa8b6a4a84 --- /dev/null +++ b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/css/print.css @@ -0,0 +1,1172 @@ +/* Original style from softwaremaniacs.org (c) Ivan Sagalaev */ +.swagger-section pre code { + display: block; + padding: 0.5em; + background: #F0F0F0; +} +.swagger-section pre code, +.swagger-section pre .subst, +.swagger-section pre .tag .title, +.swagger-section pre .lisp .title, +.swagger-section pre .clojure .built_in, +.swagger-section pre .nginx .title { + color: black; +} +.swagger-section pre .string, +.swagger-section pre .title, +.swagger-section pre .constant, +.swagger-section pre .parent, +.swagger-section pre .tag .value, +.swagger-section pre .rules .value, +.swagger-section pre .rules .value .number, +.swagger-section pre .preprocessor, +.swagger-section pre .ruby .symbol, +.swagger-section pre .ruby .symbol .string, +.swagger-section pre .aggregate, +.swagger-section pre .template_tag, +.swagger-section pre .django .variable, +.swagger-section pre .smalltalk .class, +.swagger-section pre .addition, +.swagger-section pre .flow, +.swagger-section pre .stream, +.swagger-section pre .bash .variable, +.swagger-section pre .apache .tag, +.swagger-section pre .apache .cbracket, +.swagger-section pre .tex .command, +.swagger-section pre .tex .special, +.swagger-section pre .erlang_repl .function_or_atom, +.swagger-section pre .markdown .header { + color: #800; +} +.swagger-section pre .comment, +.swagger-section pre .annotation, +.swagger-section pre .template_comment, +.swagger-section pre .diff .header, +.swagger-section pre .chunk, +.swagger-section pre .markdown .blockquote { + color: #888; +} +.swagger-section pre .number, +.swagger-section pre .date, +.swagger-section pre .regexp, +.swagger-section pre .literal, +.swagger-section pre .smalltalk .symbol, +.swagger-section pre .smalltalk .char, +.swagger-section pre .go .constant, +.swagger-section pre .change, +.swagger-section pre .markdown .bullet, +.swagger-section pre .markdown .link_url { + color: #080; +} +.swagger-section pre .label, +.swagger-section pre .javadoc, +.swagger-section pre .ruby .string, +.swagger-section pre .decorator, +.swagger-section pre .filter .argument, +.swagger-section pre .localvars, +.swagger-section pre .array, +.swagger-section pre .attr_selector, +.swagger-section pre .important, +.swagger-section pre .pseudo, +.swagger-section pre .pi, +.swagger-section pre .doctype, +.swagger-section pre .deletion, +.swagger-section pre .envvar, +.swagger-section pre .shebang, +.swagger-section pre .apache .sqbracket, +.swagger-section pre .nginx .built_in, +.swagger-section pre .tex .formula, +.swagger-section pre .erlang_repl .reserved, +.swagger-section pre .prompt, +.swagger-section pre .markdown .link_label, +.swagger-section pre .vhdl .attribute, +.swagger-section pre .clojure .attribute, +.swagger-section pre .coffeescript .property { + color: #8888ff; +} +.swagger-section pre .keyword, +.swagger-section pre .id, +.swagger-section pre .phpdoc, +.swagger-section pre .title, +.swagger-section pre .built_in, +.swagger-section pre .aggregate, +.swagger-section pre .css .tag, +.swagger-section pre .javadoctag, +.swagger-section pre .phpdoc, +.swagger-section pre .yardoctag, +.swagger-section pre .smalltalk .class, +.swagger-section pre .winutils, +.swagger-section pre .bash .variable, +.swagger-section pre .apache .tag, +.swagger-section pre .go .typename, +.swagger-section pre .tex .command, +.swagger-section pre .markdown .strong, +.swagger-section pre .request, +.swagger-section pre .status { + font-weight: bold; +} +.swagger-section pre .markdown .emphasis { + font-style: italic; +} +.swagger-section pre .nginx .built_in { + font-weight: normal; +} +.swagger-section pre .coffeescript .javascript, +.swagger-section pre .javascript .xml, +.swagger-section pre .tex .formula, +.swagger-section pre .xml .javascript, +.swagger-section pre .xml .vbscript, +.swagger-section pre .xml .css, +.swagger-section pre .xml .cdata { + opacity: 0.5; +} +.swagger-section .swagger-ui-wrap { + line-height: 1; + font-family: "Droid Sans", sans-serif; + max-width: 960px; + margin-left: auto; + margin-right: auto; +} +.swagger-section .swagger-ui-wrap b, +.swagger-section .swagger-ui-wrap strong { + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap q, +.swagger-section .swagger-ui-wrap blockquote { + quotes: none; +} +.swagger-section .swagger-ui-wrap p { + line-height: 1.4em; + padding: 0 0 10px; + color: #333333; +} +.swagger-section .swagger-ui-wrap q:before, +.swagger-section .swagger-ui-wrap q:after, +.swagger-section .swagger-ui-wrap blockquote:before, +.swagger-section .swagger-ui-wrap blockquote:after { + content: none; +} +.swagger-section .swagger-ui-wrap .heading_with_menu h1, +.swagger-section .swagger-ui-wrap .heading_with_menu h2, +.swagger-section .swagger-ui-wrap .heading_with_menu h3, +.swagger-section .swagger-ui-wrap .heading_with_menu h4, +.swagger-section .swagger-ui-wrap .heading_with_menu h5, +.swagger-section .swagger-ui-wrap .heading_with_menu h6 { + display: block; + clear: none; + float: left; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + width: 60%; +} +.swagger-section .swagger-ui-wrap table { + border-collapse: collapse; + border-spacing: 0; +} +.swagger-section .swagger-ui-wrap table thead tr th { + padding: 5px; + font-size: 0.9em; + color: #666666; + border-bottom: 1px solid #999999; +} +.swagger-section .swagger-ui-wrap table tbody tr:last-child td { + border-bottom: none; +} +.swagger-section .swagger-ui-wrap table tbody tr.offset { + background-color: #f0f0f0; +} +.swagger-section .swagger-ui-wrap table tbody tr td { + padding: 6px; + font-size: 0.9em; + border-bottom: 1px solid #cccccc; + vertical-align: top; + line-height: 1.3em; +} +.swagger-section .swagger-ui-wrap ol { + margin: 0px 0 10px; + padding: 0 0 0 18px; + list-style-type: decimal; +} +.swagger-section .swagger-ui-wrap ol li { + padding: 5px 0px; + font-size: 0.9em; + color: #333333; +} +.swagger-section .swagger-ui-wrap ol, +.swagger-section .swagger-ui-wrap ul { + list-style: none; +} +.swagger-section .swagger-ui-wrap h1 a, +.swagger-section .swagger-ui-wrap h2 a, +.swagger-section .swagger-ui-wrap h3 a, +.swagger-section .swagger-ui-wrap h4 a, +.swagger-section .swagger-ui-wrap h5 a, +.swagger-section .swagger-ui-wrap h6 a { + text-decoration: none; +} +.swagger-section .swagger-ui-wrap h1 a:hover, +.swagger-section .swagger-ui-wrap h2 a:hover, +.swagger-section .swagger-ui-wrap h3 a:hover, +.swagger-section .swagger-ui-wrap h4 a:hover, +.swagger-section .swagger-ui-wrap h5 a:hover, +.swagger-section .swagger-ui-wrap h6 a:hover { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap h1 span.divider, +.swagger-section .swagger-ui-wrap h2 span.divider, +.swagger-section .swagger-ui-wrap h3 span.divider, +.swagger-section .swagger-ui-wrap h4 span.divider, +.swagger-section .swagger-ui-wrap h5 span.divider, +.swagger-section .swagger-ui-wrap h6 span.divider { + color: #aaaaaa; +} +.swagger-section .swagger-ui-wrap a { + color: #547f00; +} +.swagger-section .swagger-ui-wrap a img { + border: none; +} +.swagger-section .swagger-ui-wrap article, +.swagger-section .swagger-ui-wrap aside, +.swagger-section .swagger-ui-wrap details, +.swagger-section .swagger-ui-wrap figcaption, +.swagger-section .swagger-ui-wrap figure, +.swagger-section .swagger-ui-wrap footer, +.swagger-section .swagger-ui-wrap header, +.swagger-section .swagger-ui-wrap hgroup, +.swagger-section .swagger-ui-wrap menu, +.swagger-section .swagger-ui-wrap nav, +.swagger-section .swagger-ui-wrap section, +.swagger-section .swagger-ui-wrap summary { + display: block; +} +.swagger-section .swagger-ui-wrap pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #fcf6db; + border: 1px solid #e5e0c6; + padding: 10px; +} +.swagger-section .swagger-ui-wrap pre code { + line-height: 1.6em; + background: none; +} +.swagger-section .swagger-ui-wrap .content > .content-type > div > label { + clear: both; + display: block; + color: #0F6AB4; + font-size: 1.1em; + margin: 0; + padding: 15px 0 5px; +} +.swagger-section .swagger-ui-wrap .content pre { + font-size: 12px; + margin-top: 5px; + padding: 5px; +} +.swagger-section .swagger-ui-wrap .icon-btn { + cursor: pointer; +} +.swagger-section .swagger-ui-wrap .info_title { + padding-bottom: 10px; + font-weight: bold; + font-size: 25px; +} +.swagger-section .swagger-ui-wrap .footer { + margin-top: 20px; +} +.swagger-section .swagger-ui-wrap p.big, +.swagger-section .swagger-ui-wrap div.big p { + font-size: 1em; + margin-bottom: 10px; +} +.swagger-section .swagger-ui-wrap form.fullwidth ol li.string input, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.url input, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.text textarea, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.numeric input { + width: 500px !important; +} +.swagger-section .swagger-ui-wrap .info_license { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_tos { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .message-fail { + color: #cc0000; +} +.swagger-section .swagger-ui-wrap .info_url { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_email { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_name { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_description { + padding-bottom: 10px; + font-size: 15px; +} +.swagger-section .swagger-ui-wrap .markdown ol li, +.swagger-section .swagger-ui-wrap .markdown ul li { + padding: 3px 0px; + line-height: 1.4em; + color: #333333; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input { + display: block; + padding: 4px; + width: auto; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input.title, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input.title, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input.title { + font-size: 1.3em; +} +.swagger-section .swagger-ui-wrap table.fullwidth { + width: 100%; +} +.swagger-section .swagger-ui-wrap .model-signature { + font-family: "Droid Sans", sans-serif; + font-size: 1em; + line-height: 1.5em; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav a { + text-decoration: none; + color: #AAA; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav a:hover { + text-decoration: underline; + color: black; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav .selected { + color: black; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap .model-signature .propType { + color: #5555aa; +} +.swagger-section .swagger-ui-wrap .model-signature pre:hover { + background-color: #ffffdd; +} +.swagger-section .swagger-ui-wrap .model-signature pre { + font-size: .85em; + line-height: 1.2em; + overflow: auto; + max-height: 200px; + cursor: pointer; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav { + display: block; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li:last-child { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li { + float: left; + margin: 0 5px 5px 0; + padding: 2px 5px 2px 0; + border-right: 1px solid #ddd; +} +.swagger-section .swagger-ui-wrap .model-signature .propOpt { + color: #555; +} +.swagger-section .swagger-ui-wrap .model-signature .snippet small { + font-size: 0.75em; +} +.swagger-section .swagger-ui-wrap .model-signature .propOptKey { + font-style: italic; +} +.swagger-section .swagger-ui-wrap .model-signature .description .strong { + font-weight: bold; + color: #000; + font-size: .9em; +} +.swagger-section .swagger-ui-wrap .model-signature .description div { + font-size: 0.9em; + line-height: 1.5em; + margin-left: 1em; +} +.swagger-section .swagger-ui-wrap .model-signature .description .stronger { + font-weight: bold; + color: #000; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper { + border-spacing: 0; + position: absolute; + background-color: #ffffff; + border: 1px solid #bbbbbb; + display: none; + font-size: 11px; + max-width: 400px; + line-height: 30px; + color: black; + padding: 5px; + margin-left: 10px; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper th { + text-align: center; + background-color: #eeeeee; + border: 1px solid #bbbbbb; + font-size: 11px; + color: #666666; + font-weight: bold; + padding: 5px; + line-height: 15px; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper .optionName { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:first-child, +.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:last-child { + display: inline; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:not(:first-child):before { + display: block; + content: ''; +} +.swagger-section .swagger-ui-wrap .model-signature .description span:last-of-type.propDesc.markdown > p:only-child { + margin-right: -3px; +} +.swagger-section .swagger-ui-wrap .model-signature .propName { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-container { + clear: both; +} +.swagger-section .swagger-ui-wrap .body-textarea { + width: 300px; + height: 100px; + border: 1px solid #aaa; +} +.swagger-section .swagger-ui-wrap .markdown p code, +.swagger-section .swagger-ui-wrap .markdown li code { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #f0f0f0; + color: black; + padding: 1px 3px; +} +.swagger-section .swagger-ui-wrap .required { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap input.parameter { + width: 300px; + border: 1px solid #aaa; +} +.swagger-section .swagger-ui-wrap h1 { + color: black; + font-size: 1.5em; + line-height: 1.3em; + padding: 10px 0 10px 0; + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .heading_with_menu { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap .heading_with_menu ul { + display: block; + clear: none; + float: right; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + margin-top: 10px; +} +.swagger-section .swagger-ui-wrap h2 { + color: black; + font-size: 1.3em; + padding: 10px 0 10px 0; +} +.swagger-section .swagger-ui-wrap h2 a { + color: black; +} +.swagger-section .swagger-ui-wrap h2 span.sub { + font-size: 0.7em; + color: #999999; + font-style: italic; +} +.swagger-section .swagger-ui-wrap h2 span.sub a { + color: #777777; +} +.swagger-section .swagger-ui-wrap span.weak { + color: #666666; +} +.swagger-section .swagger-ui-wrap .message-success { + color: #89BF04; +} +.swagger-section .swagger-ui-wrap caption, +.swagger-section .swagger-ui-wrap th, +.swagger-section .swagger-ui-wrap td { + text-align: left; + font-weight: normal; + vertical-align: middle; +} +.swagger-section .swagger-ui-wrap .code { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.text textarea { + font-family: "Droid Sans", sans-serif; + height: 250px; + padding: 4px; + display: block; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.select select { + display: block; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean label { + display: block; + float: left; + clear: none; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean input { + display: block; + float: left; + clear: none; + margin: 0 5px 0 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.required label { + color: black; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label { + display: block; + clear: both; + width: auto; + padding: 0 0 3px; + color: #666666; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label abbr { + padding-left: 3px; + color: #888888; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li p.inline-hints { + margin-left: 0; + font-style: italic; + font-size: 0.9em; + margin: 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.buttons { + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap span.blank, +.swagger-section .swagger-ui-wrap span.empty { + color: #888888; + font-style: italic; +} +.swagger-section .swagger-ui-wrap .markdown h3 { + color: #547f00; +} +.swagger-section .swagger-ui-wrap .markdown h4 { + color: #666666; +} +.swagger-section .swagger-ui-wrap .markdown pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #fcf6db; + border: 1px solid #e5e0c6; + padding: 10px; + margin: 0 0 10px 0; +} +.swagger-section .swagger-ui-wrap .markdown pre code { + line-height: 1.6em; +} +.swagger-section .swagger-ui-wrap div.gist { + margin: 20px 0 25px 0 !important; +} +.swagger-section .swagger-ui-wrap ul#resources { + font-family: "Droid Sans", sans-serif; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource { + border-bottom: 1px solid #dddddd; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading h2 a, +.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading h2 a { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading ul.options li a, +.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading ul.options li a { + color: #555555; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:last-child { + border-bottom: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading { + border: 1px solid transparent; + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options { + overflow: hidden; + padding: 0; + display: block; + clear: none; + float: right; + margin: 14px 10px 0 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li { + float: left; + clear: none; + margin: 0; + padding: 2px 10px; + border-right: 1px solid #dddddd; + color: #666666; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a { + color: #aaaaaa; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover { + text-decoration: underline; + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:active, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a.active { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.last { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 { + color: #999999; + padding-left: 0; + display: block; + clear: none; + float: left; + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a { + color: #999999; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation { + float: none; + clear: both; + overflow: hidden; + display: block; + margin: 0 0 10px; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading { + float: none; + clear: both; + overflow: hidden; + display: block; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 { + display: block; + clear: none; + float: left; + width: auto; + margin: 0; + padding: 0; + line-height: 1.1em; + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path { + padding-left: 10px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a { + color: black; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.http_method a { + text-transform: uppercase; + text-decoration: none; + color: white; + display: inline-block; + width: 50px; + font-size: 0.7em; + text-align: center; + padding: 7px 0 4px; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + -o-border-radius: 2px; + -ms-border-radius: 2px; + -khtml-border-radius: 2px; + border-radius: 2px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span { + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options { + overflow: hidden; + padding: 0; + display: block; + clear: none; + float: right; + margin: 6px 10px 0 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li { + float: left; + clear: none; + margin: 0; + padding: 2px 10px; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a { + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li.access { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content { + border-top: none; + padding: 10px; + -moz-border-radius-bottomleft: 6px; + -webkit-border-bottom-left-radius: 6px; + -o-border-bottom-left-radius: 6px; + -ms-border-bottom-left-radius: 6px; + -khtml-border-bottom-left-radius: 6px; + border-bottom-left-radius: 6px; + -moz-border-radius-bottomright: 6px; + -webkit-border-bottom-right-radius: 6px; + -o-border-bottom-right-radius: 6px; + -ms-border-bottom-right-radius: 6px; + -khtml-border-bottom-right-radius: 6px; + border-bottom-right-radius: 6px; + margin: 0 0 20px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content h4 { + font-size: 1.1em; + margin: 0; + padding: 15px 0 5px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header a { + padding: 4px 0 0 10px; + display: inline-block; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header input.submit { + display: block; + clear: none; + float: left; + padding: 6px 8px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header span.response_throbber { + background-image: url('../images/throbber.gif'); + width: 128px; + height: 16px; + display: block; + clear: none; + float: right; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form input[type='text'].error { + outline: 2px solid black; + outline-color: #cc0000; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + padding: 10px; + font-size: 0.9em; + max-height: 400px; + overflow-y: auto; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading { + background-color: #f9f2e9; + border: 1px solid #f0e0ca; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.http_method a { + background-color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #f0e0ca; + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a { + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content { + background-color: #faf5ee; + border: 1px solid #f0e0ca; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content h4 { + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header a { + color: #dcb67f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading { + background-color: #fcffcd; + border: 1px solid black; + border-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading h3 span.http_method a { + text-transform: uppercase; + background-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #ffd20f; + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li a { + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content { + background-color: #fcffcd; + border: 1px solid black; + border-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content h4 { + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content div.sandbox_header a { + color: #6fc992; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading { + background-color: #f5e8e8; + border: 1px solid #e8c6c7; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.http_method a { + text-transform: uppercase; + background-color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #e8c6c7; + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a { + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { + background-color: #f7eded; + border: 1px solid #e8c6c7; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content h4 { + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header a { + color: #c8787a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading { + background-color: #e7f6ec; + border: 1px solid #c3e8d1; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.http_method a { + background-color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3e8d1; + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a { + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content { + background-color: #ebf7f0; + border: 1px solid #c3e8d1; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h4 { + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header a { + color: #6fc992; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading { + background-color: #FCE9E3; + border: 1px solid #F5D5C3; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.http_method a { + background-color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #f0cecb; + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a { + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content { + background-color: #faf0ef; + border: 1px solid #f0cecb; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content h4 { + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header a { + color: #dcb67f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading { + background-color: #e7f0f7; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.http_method a { + background-color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3d9ec; + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content h4 { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a { + color: #6fa5d2; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading { + background-color: #e7f0f7; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading h3 span.http_method a { + background-color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3d9ec; + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li a { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content h4 { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content div.sandbox_header a { + color: #6fa5d2; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { + border-top: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.last { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:hover, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:active, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a.active { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap p#colophon { + margin: 0 15px 40px 15px; + padding: 10px 0; + font-size: 0.8em; + border-top: 1px solid #dddddd; + font-family: "Droid Sans", sans-serif; + color: #999999; + font-style: italic; +} +.swagger-section .swagger-ui-wrap p#colophon a { + text-decoration: none; + color: #547f00; +} +.swagger-section .swagger-ui-wrap h3 { + color: black; + font-size: 1.1em; + padding: 10px 0 10px 0; +} +.swagger-section .swagger-ui-wrap .markdown ol, +.swagger-section .swagger-ui-wrap .markdown ul { + font-family: "Droid Sans", sans-serif; + margin: 5px 0 10px; + padding: 0 0 0 18px; + list-style-type: disc; +} +.swagger-section .swagger-ui-wrap form.form_box { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; + padding: 10px; +} +.swagger-section .swagger-ui-wrap form.form_box label { + color: #0f6ab4 !important; +} +.swagger-section .swagger-ui-wrap form.form_box input[type=submit] { + display: block; + padding: 10px; +} +.swagger-section .swagger-ui-wrap form.form_box p.weak { + font-size: 0.8em; +} +.swagger-section .swagger-ui-wrap form.form_box p { + font-size: 0.9em; + padding: 0 0 15px; + color: #7e7b6d; +} +.swagger-section .swagger-ui-wrap form.form_box p a { + color: #646257; +} +.swagger-section .swagger-ui-wrap form.form_box p strong { + color: black; +} +.swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child { + padding-bottom: 0; +} +.swagger-section .title { + font-style: bold; +} +.swagger-section .secondary_form { + display: none; +} +.swagger-section .main_image { + display: block; + margin-left: auto; + margin-right: auto; +} +.swagger-section .oauth_body { + margin-left: 100px; + margin-right: 100px; +} +.swagger-section .oauth_submit { + text-align: center; +} +.swagger-section .api-popup-dialog { + z-index: 10000; + position: absolute; + width: 500px; + background: #FFF; + padding: 20px; + border: 1px solid #ccc; + border-radius: 5px; + display: none; + font-size: 13px; + color: #777; +} +.swagger-section .api-popup-dialog .api-popup-title { + font-size: 24px; + padding: 10px 0; +} +.swagger-section .api-popup-dialog .api-popup-title { + font-size: 24px; + padding: 10px 0; +} +.swagger-section .api-popup-dialog p.error-msg { + padding-left: 5px; + padding-bottom: 5px; +} +.swagger-section .api-popup-dialog button.api-popup-authbtn { + height: 30px; +} +.swagger-section .api-popup-dialog button.api-popup-cancel { + height: 30px; +} +.swagger-section .api-popup-scopes { + padding: 10px 20px; +} +.swagger-section .api-popup-scopes li { + padding: 5px 0; + line-height: 20px; +} +.swagger-section .api-popup-scopes .api-scope-desc { + padding-left: 20px; + font-style: italic; +} +.swagger-section .api-popup-scopes li input { + position: relative; + top: 2px; +} +.swagger-section .api-popup-actions { + padding-top: 10px; +} +#header { + display: none; +} +.swagger-section .swagger-ui-wrap .model-signature pre { + max-height: none; +} +.swagger-section .swagger-ui-wrap .body-textarea { + width: 100px; +} +.swagger-section .swagger-ui-wrap input.parameter { + width: 100px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options { + display: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints { + display: block !important; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content { + display: block !important; +} diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/css/reset.css b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/css/reset.css new file mode 100644 index 0000000000000..b2b078943c451 --- /dev/null +++ b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/css/reset.css @@ -0,0 +1,125 @@ +/* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 */ +html, +body, +div, +span, +applet, +object, +iframe, +h1, +h2, +h3, +h4, +h5, +h6, +p, +blockquote, +pre, +a, +abbr, +acronym, +address, +big, +cite, +code, +del, +dfn, +em, +img, +ins, +kbd, +q, +s, +samp, +small, +strike, +strong, +sub, +sup, +tt, +var, +b, +u, +i, +center, +dl, +dt, +dd, +ol, +ul, +li, +fieldset, +form, +label, +legend, +table, +caption, +tbody, +tfoot, +thead, +tr, +th, +td, +article, +aside, +canvas, +details, +embed, +figure, +figcaption, +footer, +header, +hgroup, +menu, +nav, +output, +ruby, +section, +summary, +time, +mark, +audio, +video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +menu, +nav, +section { + display: block; +} +body { + line-height: 1; +} +ol, +ul { + list-style: none; +} +blockquote, +q { + quotes: none; +} +blockquote:before, +blockquote:after, +q:before, +q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/css/screen.css b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/css/screen.css new file mode 100644 index 0000000000000..436cc28edd312 --- /dev/null +++ b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/css/screen.css @@ -0,0 +1,1279 @@ +/* Original style from softwaremaniacs.org (c) Ivan Sagalaev */ +.swagger-section pre code { + display: block; + padding: 0.5em; + background: #F0F0F0; +} +.swagger-section pre code, +.swagger-section pre .subst, +.swagger-section pre .tag .title, +.swagger-section pre .lisp .title, +.swagger-section pre .clojure .built_in, +.swagger-section pre .nginx .title { + color: black; +} +.swagger-section pre .string, +.swagger-section pre .title, +.swagger-section pre .constant, +.swagger-section pre .parent, +.swagger-section pre .tag .value, +.swagger-section pre .rules .value, +.swagger-section pre .rules .value .number, +.swagger-section pre .preprocessor, +.swagger-section pre .ruby .symbol, +.swagger-section pre .ruby .symbol .string, +.swagger-section pre .aggregate, +.swagger-section pre .template_tag, +.swagger-section pre .django .variable, +.swagger-section pre .smalltalk .class, +.swagger-section pre .addition, +.swagger-section pre .flow, +.swagger-section pre .stream, +.swagger-section pre .bash .variable, +.swagger-section pre .apache .tag, +.swagger-section pre .apache .cbracket, +.swagger-section pre .tex .command, +.swagger-section pre .tex .special, +.swagger-section pre .erlang_repl .function_or_atom, +.swagger-section pre .markdown .header { + color: #800; +} +.swagger-section pre .comment, +.swagger-section pre .annotation, +.swagger-section pre .template_comment, +.swagger-section pre .diff .header, +.swagger-section pre .chunk, +.swagger-section pre .markdown .blockquote { + color: #888; +} +.swagger-section pre .number, +.swagger-section pre .date, +.swagger-section pre .regexp, +.swagger-section pre .literal, +.swagger-section pre .smalltalk .symbol, +.swagger-section pre .smalltalk .char, +.swagger-section pre .go .constant, +.swagger-section pre .change, +.swagger-section pre .markdown .bullet, +.swagger-section pre .markdown .link_url { + color: #080; +} +.swagger-section pre .label, +.swagger-section pre .javadoc, +.swagger-section pre .ruby .string, +.swagger-section pre .decorator, +.swagger-section pre .filter .argument, +.swagger-section pre .localvars, +.swagger-section pre .array, +.swagger-section pre .attr_selector, +.swagger-section pre .important, +.swagger-section pre .pseudo, +.swagger-section pre .pi, +.swagger-section pre .doctype, +.swagger-section pre .deletion, +.swagger-section pre .envvar, +.swagger-section pre .shebang, +.swagger-section pre .apache .sqbracket, +.swagger-section pre .nginx .built_in, +.swagger-section pre .tex .formula, +.swagger-section pre .erlang_repl .reserved, +.swagger-section pre .prompt, +.swagger-section pre .markdown .link_label, +.swagger-section pre .vhdl .attribute, +.swagger-section pre .clojure .attribute, +.swagger-section pre .coffeescript .property { + color: #8888ff; +} +.swagger-section pre .keyword, +.swagger-section pre .id, +.swagger-section pre .phpdoc, +.swagger-section pre .title, +.swagger-section pre .built_in, +.swagger-section pre .aggregate, +.swagger-section pre .css .tag, +.swagger-section pre .javadoctag, +.swagger-section pre .phpdoc, +.swagger-section pre .yardoctag, +.swagger-section pre .smalltalk .class, +.swagger-section pre .winutils, +.swagger-section pre .bash .variable, +.swagger-section pre .apache .tag, +.swagger-section pre .go .typename, +.swagger-section pre .tex .command, +.swagger-section pre .markdown .strong, +.swagger-section pre .request, +.swagger-section pre .status { + font-weight: bold; +} +.swagger-section pre .markdown .emphasis { + font-style: italic; +} +.swagger-section pre .nginx .built_in { + font-weight: normal; +} +.swagger-section pre .coffeescript .javascript, +.swagger-section pre .javascript .xml, +.swagger-section pre .tex .formula, +.swagger-section pre .xml .javascript, +.swagger-section pre .xml .vbscript, +.swagger-section pre .xml .css, +.swagger-section pre .xml .cdata { + opacity: 0.5; +} +.swagger-section .swagger-ui-wrap { + line-height: 1; + font-family: "Droid Sans", sans-serif; + max-width: 960px; + margin-left: auto; + margin-right: auto; +} +.swagger-section .swagger-ui-wrap b, +.swagger-section .swagger-ui-wrap strong { + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap q, +.swagger-section .swagger-ui-wrap blockquote { + quotes: none; +} +.swagger-section .swagger-ui-wrap p { + line-height: 1.4em; + padding: 0 0 10px; + color: #333333; +} +.swagger-section .swagger-ui-wrap q:before, +.swagger-section .swagger-ui-wrap q:after, +.swagger-section .swagger-ui-wrap blockquote:before, +.swagger-section .swagger-ui-wrap blockquote:after { + content: none; +} +.swagger-section .swagger-ui-wrap .heading_with_menu h1, +.swagger-section .swagger-ui-wrap .heading_with_menu h2, +.swagger-section .swagger-ui-wrap .heading_with_menu h3, +.swagger-section .swagger-ui-wrap .heading_with_menu h4, +.swagger-section .swagger-ui-wrap .heading_with_menu h5, +.swagger-section .swagger-ui-wrap .heading_with_menu h6 { + display: block; + clear: none; + float: left; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + width: 60%; +} +.swagger-section .swagger-ui-wrap table { + border-collapse: collapse; + border-spacing: 0; +} +.swagger-section .swagger-ui-wrap table thead tr th { + padding: 5px; + font-size: 0.9em; + color: #666666; + border-bottom: 1px solid #999999; +} +.swagger-section .swagger-ui-wrap table tbody tr:last-child td { + border-bottom: none; +} +.swagger-section .swagger-ui-wrap table tbody tr.offset { + background-color: #f0f0f0; +} +.swagger-section .swagger-ui-wrap table tbody tr td { + padding: 6px; + font-size: 0.9em; + border-bottom: 1px solid #cccccc; + vertical-align: top; + line-height: 1.3em; +} +.swagger-section .swagger-ui-wrap ol { + margin: 0px 0 10px; + padding: 0 0 0 18px; + list-style-type: decimal; +} +.swagger-section .swagger-ui-wrap ol li { + padding: 5px 0px; + font-size: 0.9em; + color: #333333; +} +.swagger-section .swagger-ui-wrap ol, +.swagger-section .swagger-ui-wrap ul { + list-style: none; +} +.swagger-section .swagger-ui-wrap h1 a, +.swagger-section .swagger-ui-wrap h2 a, +.swagger-section .swagger-ui-wrap h3 a, +.swagger-section .swagger-ui-wrap h4 a, +.swagger-section .swagger-ui-wrap h5 a, +.swagger-section .swagger-ui-wrap h6 a { + text-decoration: none; +} +.swagger-section .swagger-ui-wrap h1 a:hover, +.swagger-section .swagger-ui-wrap h2 a:hover, +.swagger-section .swagger-ui-wrap h3 a:hover, +.swagger-section .swagger-ui-wrap h4 a:hover, +.swagger-section .swagger-ui-wrap h5 a:hover, +.swagger-section .swagger-ui-wrap h6 a:hover { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap h1 span.divider, +.swagger-section .swagger-ui-wrap h2 span.divider, +.swagger-section .swagger-ui-wrap h3 span.divider, +.swagger-section .swagger-ui-wrap h4 span.divider, +.swagger-section .swagger-ui-wrap h5 span.divider, +.swagger-section .swagger-ui-wrap h6 span.divider { + color: #aaaaaa; +} +.swagger-section .swagger-ui-wrap a { + color: #547f00; +} +.swagger-section .swagger-ui-wrap a img { + border: none; +} +.swagger-section .swagger-ui-wrap article, +.swagger-section .swagger-ui-wrap aside, +.swagger-section .swagger-ui-wrap details, +.swagger-section .swagger-ui-wrap figcaption, +.swagger-section .swagger-ui-wrap figure, +.swagger-section .swagger-ui-wrap footer, +.swagger-section .swagger-ui-wrap header, +.swagger-section .swagger-ui-wrap hgroup, +.swagger-section .swagger-ui-wrap menu, +.swagger-section .swagger-ui-wrap nav, +.swagger-section .swagger-ui-wrap section, +.swagger-section .swagger-ui-wrap summary { + display: block; +} +.swagger-section .swagger-ui-wrap pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #fcf6db; + border: 1px solid #e5e0c6; + padding: 10px; +} +.swagger-section .swagger-ui-wrap pre code { + line-height: 1.6em; + background: none; +} +.swagger-section .swagger-ui-wrap .content > .content-type > div > label { + clear: both; + display: block; + color: #0F6AB4; + font-size: 1.1em; + margin: 0; + padding: 15px 0 5px; +} +.swagger-section .swagger-ui-wrap .content pre { + font-size: 12px; + margin-top: 5px; + padding: 5px; +} +.swagger-section .swagger-ui-wrap .icon-btn { + cursor: pointer; +} +.swagger-section .swagger-ui-wrap .info_title { + padding-bottom: 10px; + font-weight: bold; + font-size: 25px; +} +.swagger-section .swagger-ui-wrap .footer { + margin-top: 20px; +} +.swagger-section .swagger-ui-wrap p.big, +.swagger-section .swagger-ui-wrap div.big p { + font-size: 1em; + margin-bottom: 10px; +} +.swagger-section .swagger-ui-wrap form.fullwidth ol li.string input, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.url input, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.text textarea, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.numeric input { + width: 500px !important; +} +.swagger-section .swagger-ui-wrap .info_license { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_tos { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .message-fail { + color: #cc0000; +} +.swagger-section .swagger-ui-wrap .info_url { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_email { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_name { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_description { + padding-bottom: 10px; + font-size: 15px; +} +.swagger-section .swagger-ui-wrap .markdown ol li, +.swagger-section .swagger-ui-wrap .markdown ul li { + padding: 3px 0px; + line-height: 1.4em; + color: #333333; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input { + display: block; + padding: 4px; + width: auto; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input.title, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input.title, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input.title { + font-size: 1.3em; +} +.swagger-section .swagger-ui-wrap table.fullwidth { + width: 100%; +} +.swagger-section .swagger-ui-wrap .model-signature { + font-family: "Droid Sans", sans-serif; + font-size: 1em; + line-height: 1.5em; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav a { + text-decoration: none; + color: #AAA; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav a:hover { + text-decoration: underline; + color: black; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav .selected { + color: black; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap .model-signature .propType { + color: #5555aa; +} +.swagger-section .swagger-ui-wrap .model-signature pre:hover { + background-color: #ffffdd; +} +.swagger-section .swagger-ui-wrap .model-signature pre { + font-size: .85em; + line-height: 1.2em; + overflow: auto; + max-height: 200px; + cursor: pointer; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav { + display: block; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li:last-child { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li { + float: left; + margin: 0 5px 5px 0; + padding: 2px 5px 2px 0; + border-right: 1px solid #ddd; +} +.swagger-section .swagger-ui-wrap .model-signature .propOpt { + color: #555; +} +.swagger-section .swagger-ui-wrap .model-signature .snippet small { + font-size: 0.75em; +} +.swagger-section .swagger-ui-wrap .model-signature .propOptKey { + font-style: italic; +} +.swagger-section .swagger-ui-wrap .model-signature .description .strong { + font-weight: bold; + color: #000; + font-size: .9em; +} +.swagger-section .swagger-ui-wrap .model-signature .description div { + font-size: 0.9em; + line-height: 1.5em; + margin-left: 1em; +} +.swagger-section .swagger-ui-wrap .model-signature .description .stronger { + font-weight: bold; + color: #000; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper { + border-spacing: 0; + position: absolute; + background-color: #ffffff; + border: 1px solid #bbbbbb; + display: none; + font-size: 11px; + max-width: 400px; + line-height: 30px; + color: black; + padding: 5px; + margin-left: 10px; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper th { + text-align: center; + background-color: #eeeeee; + border: 1px solid #bbbbbb; + font-size: 11px; + color: #666666; + font-weight: bold; + padding: 5px; + line-height: 15px; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper .optionName { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:first-child, +.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:last-child { + display: inline; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:not(:first-child):before { + display: block; + content: ''; +} +.swagger-section .swagger-ui-wrap .model-signature .description span:last-of-type.propDesc.markdown > p:only-child { + margin-right: -3px; +} +.swagger-section .swagger-ui-wrap .model-signature .propName { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-container { + clear: both; +} +.swagger-section .swagger-ui-wrap .body-textarea { + width: 300px; + height: 100px; + border: 1px solid #aaa; +} +.swagger-section .swagger-ui-wrap .markdown p code, +.swagger-section .swagger-ui-wrap .markdown li code { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #f0f0f0; + color: black; + padding: 1px 3px; +} +.swagger-section .swagger-ui-wrap .required { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap input.parameter { + width: 300px; + border: 1px solid #aaa; +} +.swagger-section .swagger-ui-wrap h1 { + color: black; + font-size: 1.5em; + line-height: 1.3em; + padding: 10px 0 10px 0; + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .heading_with_menu { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap .heading_with_menu ul { + display: block; + clear: none; + float: right; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + margin-top: 10px; +} +.swagger-section .swagger-ui-wrap h2 { + color: black; + font-size: 1.3em; + padding: 10px 0 10px 0; +} +.swagger-section .swagger-ui-wrap h2 a { + color: black; +} +.swagger-section .swagger-ui-wrap h2 span.sub { + font-size: 0.7em; + color: #999999; + font-style: italic; +} +.swagger-section .swagger-ui-wrap h2 span.sub a { + color: #777777; +} +.swagger-section .swagger-ui-wrap span.weak { + color: #666666; +} +.swagger-section .swagger-ui-wrap .message-success { + color: #89BF04; +} +.swagger-section .swagger-ui-wrap caption, +.swagger-section .swagger-ui-wrap th, +.swagger-section .swagger-ui-wrap td { + text-align: left; + font-weight: normal; + vertical-align: middle; +} +.swagger-section .swagger-ui-wrap .code { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.text textarea { + font-family: "Droid Sans", sans-serif; + height: 250px; + padding: 4px; + display: block; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.select select { + display: block; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean label { + display: block; + float: left; + clear: none; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean input { + display: block; + float: left; + clear: none; + margin: 0 5px 0 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.required label { + color: black; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label { + display: block; + clear: both; + width: auto; + padding: 0 0 3px; + color: #666666; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label abbr { + padding-left: 3px; + color: #888888; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li p.inline-hints { + margin-left: 0; + font-style: italic; + font-size: 0.9em; + margin: 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.buttons { + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap span.blank, +.swagger-section .swagger-ui-wrap span.empty { + color: #888888; + font-style: italic; +} +.swagger-section .swagger-ui-wrap .markdown h3 { + color: #547f00; +} +.swagger-section .swagger-ui-wrap .markdown h4 { + color: #666666; +} +.swagger-section .swagger-ui-wrap .markdown pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #fcf6db; + border: 1px solid #e5e0c6; + padding: 10px; + margin: 0 0 10px 0; +} +.swagger-section .swagger-ui-wrap .markdown pre code { + line-height: 1.6em; +} +.swagger-section .swagger-ui-wrap div.gist { + margin: 20px 0 25px 0 !important; +} +.swagger-section .swagger-ui-wrap ul#resources { + font-family: "Droid Sans", sans-serif; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource { + border-bottom: 1px solid #dddddd; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading h2 a, +.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading h2 a { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading ul.options li a, +.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading ul.options li a { + color: #555555; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:last-child { + border-bottom: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading { + border: 1px solid transparent; + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options { + overflow: hidden; + padding: 0; + display: block; + clear: none; + float: right; + margin: 14px 10px 0 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li { + float: left; + clear: none; + margin: 0; + padding: 2px 10px; + border-right: 1px solid #dddddd; + color: #666666; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a { + color: #aaaaaa; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover { + text-decoration: underline; + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:active, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a.active { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.last { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 { + color: #999999; + padding-left: 0; + display: block; + clear: none; + float: left; + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a { + color: #999999; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation { + float: none; + clear: both; + overflow: hidden; + display: block; + margin: 0 0 10px; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading { + float: none; + clear: both; + overflow: hidden; + display: block; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 { + display: block; + clear: none; + float: left; + width: auto; + margin: 0; + padding: 0; + line-height: 1.1em; + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path { + padding-left: 10px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a { + color: black; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.http_method a { + text-transform: uppercase; + text-decoration: none; + color: white; + display: inline-block; + width: 50px; + font-size: 0.7em; + text-align: center; + padding: 7px 0 4px; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + -o-border-radius: 2px; + -ms-border-radius: 2px; + -khtml-border-radius: 2px; + border-radius: 2px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span { + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options { + overflow: hidden; + padding: 0; + display: block; + clear: none; + float: right; + margin: 6px 10px 0 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li { + float: left; + clear: none; + margin: 0; + padding: 2px 10px; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a { + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li.access { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content { + border-top: none; + padding: 10px; + -moz-border-radius-bottomleft: 6px; + -webkit-border-bottom-left-radius: 6px; + -o-border-bottom-left-radius: 6px; + -ms-border-bottom-left-radius: 6px; + -khtml-border-bottom-left-radius: 6px; + border-bottom-left-radius: 6px; + -moz-border-radius-bottomright: 6px; + -webkit-border-bottom-right-radius: 6px; + -o-border-bottom-right-radius: 6px; + -ms-border-bottom-right-radius: 6px; + -khtml-border-bottom-right-radius: 6px; + border-bottom-right-radius: 6px; + margin: 0 0 20px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content h4 { + font-size: 1.1em; + margin: 0; + padding: 15px 0 5px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header a { + padding: 4px 0 0 10px; + display: inline-block; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header input.submit { + display: block; + clear: none; + float: left; + padding: 6px 8px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header span.response_throbber { + background-image: url('../images/throbber.gif'); + width: 128px; + height: 16px; + display: block; + clear: none; + float: right; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form input[type='text'].error { + outline: 2px solid black; + outline-color: #cc0000; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + padding: 10px; + font-size: 0.9em; + max-height: 400px; + overflow-y: auto; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading { + background-color: #f9f2e9; + border: 1px solid #f0e0ca; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.http_method a { + background-color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #f0e0ca; + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a { + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content { + background-color: #faf5ee; + border: 1px solid #f0e0ca; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content h4 { + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header a { + color: #dcb67f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading { + background-color: #fcffcd; + border: 1px solid black; + border-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading h3 span.http_method a { + text-transform: uppercase; + background-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #ffd20f; + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li a { + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content { + background-color: #fcffcd; + border: 1px solid black; + border-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content h4 { + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content div.sandbox_header a { + color: #6fc992; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading { + background-color: #f5e8e8; + border: 1px solid #e8c6c7; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.http_method a { + text-transform: uppercase; + background-color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #e8c6c7; + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a { + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { + background-color: #f7eded; + border: 1px solid #e8c6c7; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content h4 { + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header a { + color: #c8787a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading { + background-color: #e7f6ec; + border: 1px solid #c3e8d1; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.http_method a { + background-color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3e8d1; + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a { + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content { + background-color: #ebf7f0; + border: 1px solid #c3e8d1; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h4 { + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header a { + color: #6fc992; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading { + background-color: #FCE9E3; + border: 1px solid #F5D5C3; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.http_method a { + background-color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #f0cecb; + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a { + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content { + background-color: #faf0ef; + border: 1px solid #f0cecb; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content h4 { + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header a { + color: #dcb67f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading { + background-color: #e7f0f7; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.http_method a { + background-color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3d9ec; + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content h4 { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a { + color: #6fa5d2; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading { + background-color: #e7f0f7; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading h3 span.http_method a { + background-color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3d9ec; + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li a { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content h4 { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content div.sandbox_header a { + color: #6fa5d2; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { + border-top: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.last { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:hover, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:active, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a.active { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap p#colophon { + margin: 0 15px 40px 15px; + padding: 10px 0; + font-size: 0.8em; + border-top: 1px solid #dddddd; + font-family: "Droid Sans", sans-serif; + color: #999999; + font-style: italic; +} +.swagger-section .swagger-ui-wrap p#colophon a { + text-decoration: none; + color: #547f00; +} +.swagger-section .swagger-ui-wrap h3 { + color: black; + font-size: 1.1em; + padding: 10px 0 10px 0; +} +.swagger-section .swagger-ui-wrap .markdown ol, +.swagger-section .swagger-ui-wrap .markdown ul { + font-family: "Droid Sans", sans-serif; + margin: 5px 0 10px; + padding: 0 0 0 18px; + list-style-type: disc; +} +.swagger-section .swagger-ui-wrap form.form_box { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; + padding: 10px; +} +.swagger-section .swagger-ui-wrap form.form_box label { + color: #0f6ab4 !important; +} +.swagger-section .swagger-ui-wrap form.form_box input[type=submit] { + display: block; + padding: 10px; +} +.swagger-section .swagger-ui-wrap form.form_box p.weak { + font-size: 0.8em; +} +.swagger-section .swagger-ui-wrap form.form_box p { + font-size: 0.9em; + padding: 0 0 15px; + color: #7e7b6d; +} +.swagger-section .swagger-ui-wrap form.form_box p a { + color: #646257; +} +.swagger-section .swagger-ui-wrap form.form_box p strong { + color: black; +} +.swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child { + padding-bottom: 0; +} +.swagger-section .title { + font-style: bold; +} +.swagger-section .secondary_form { + display: none; +} +.swagger-section .main_image { + display: block; + margin-left: auto; + margin-right: auto; +} +.swagger-section .oauth_body { + margin-left: 100px; + margin-right: 100px; +} +.swagger-section .oauth_submit { + text-align: center; +} +.swagger-section .api-popup-dialog { + z-index: 10000; + position: absolute; + width: 500px; + background: #FFF; + padding: 20px; + border: 1px solid #ccc; + border-radius: 5px; + display: none; + font-size: 13px; + color: #777; +} +.swagger-section .api-popup-dialog .api-popup-title { + font-size: 24px; + padding: 10px 0; +} +.swagger-section .api-popup-dialog .api-popup-title { + font-size: 24px; + padding: 10px 0; +} +.swagger-section .api-popup-dialog p.error-msg { + padding-left: 5px; + padding-bottom: 5px; +} +.swagger-section .api-popup-dialog button.api-popup-authbtn { + height: 30px; +} +.swagger-section .api-popup-dialog button.api-popup-cancel { + height: 30px; +} +.swagger-section .api-popup-scopes { + padding: 10px 20px; +} +.swagger-section .api-popup-scopes li { + padding: 5px 0; + line-height: 20px; +} +.swagger-section .api-popup-scopes .api-scope-desc { + padding-left: 20px; + font-style: italic; +} +.swagger-section .api-popup-scopes li input { + position: relative; + top: 2px; +} +.swagger-section .api-popup-actions { + padding-top: 10px; +} +.swagger-section .access { + float: right; +} +.swagger-section .auth { + float: right; +} +.swagger-section .api-ic { + height: 18px; + vertical-align: middle; + display: inline-block; + background: url(../images/explorer_icons.png) no-repeat; +} +.swagger-section .api-ic .api_information_panel { + position: relative; + margin-top: 20px; + margin-left: -5px; + background: #FFF; + border: 1px solid #ccc; + border-radius: 5px; + display: none; + font-size: 13px; + max-width: 300px; + line-height: 30px; + color: black; + padding: 5px; +} +.swagger-section .api-ic .api_information_panel p .api-msg-enabled { + color: green; +} +.swagger-section .api-ic .api_information_panel p .api-msg-disabled { + color: red; +} +.swagger-section .api-ic:hover .api_information_panel { + position: absolute; + display: block; +} +.swagger-section .ic-info { + background-position: 0 0; + width: 18px; + margin-top: -6px; + margin-left: 4px; +} +.swagger-section .ic-warning { + background-position: -60px 0; + width: 18px; + margin-top: -6px; + margin-left: 4px; +} +.swagger-section .ic-error { + background-position: -30px 0; + width: 18px; + margin-top: -6px; + margin-left: 4px; +} +.swagger-section .ic-off { + background-position: -90px 0; + width: 58px; + margin-top: -4px; + cursor: pointer; +} +.swagger-section .ic-on { + background-position: -160px 0; + width: 58px; + margin-top: -4px; + cursor: pointer; +} +.swagger-section #header { + background-color: #89bf04; + padding: 14px; +} +.swagger-section #header a#logo { + font-size: 1.5em; + font-weight: bold; + text-decoration: none; + background: transparent url(../images/logo_small.png) no-repeat left center; + padding: 20px 0 20px 40px; + color: white; +} +.swagger-section #header form#api_selector { + display: block; + clear: none; + float: right; +} +.swagger-section #header form#api_selector .input { + display: block; + clear: none; + float: left; + margin: 0 10px 0 0; +} +.swagger-section #header form#api_selector .input input#input_apiKey { + width: 200px; +} +.swagger-section #header form#api_selector .input input#input_baseUrl { + width: 400px; +} +.swagger-section #header form#api_selector .input a#explore { + display: block; + text-decoration: none; + font-weight: bold; + padding: 6px 8px; + font-size: 0.9em; + color: white; + background-color: #547f00; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -o-border-radius: 4px; + -ms-border-radius: 4px; + -khtml-border-radius: 4px; + border-radius: 4px; +} +.swagger-section #header form#api_selector .input a#explore:hover { + background-color: #547f00; +} +.swagger-section #header form#api_selector .input input { + font-size: 0.9em; + padding: 3px; + margin: 0; +} +.swagger-section #content_message { + margin: 10px 15px; + font-style: italic; + color: #999999; +} +.swagger-section #message-bar { + min-height: 30px; + text-align: center; + padding-top: 10px; +} diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/css/style.css b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/css/style.css new file mode 100644 index 0000000000000..57273496fae13 --- /dev/null +++ b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/css/style.css @@ -0,0 +1,250 @@ +/* Modified by X.Commerce, Inc. d/b/a/ Magento, Inc., Modifications © 2015 X.Commerce, Inc. d/b/a/ Magento, Inc */ +.swagger-section #header a#logo { + font-size: 1.5em; + font-weight: bold; + text-decoration: none; + background: transparent no-repeat left center; + padding: 20px 0 20px 40px; +} +#text-head { + font-size: 80px; + font-family: 'Roboto', sans-serif; + color: #ffffff; + float: right; + margin-right: 20%; +} +.navbar-fixed-top .navbar-nav { + height: auto; +} +.navbar-fixed-top .navbar-brand { + height: auto; +} +.navbar-header { + height: auto; +} +.navbar-inverse { + background-color: #000; + border-color: #000; +} +#navbar-brand { + margin-left: 20%; +} +.navtext { + font-size: 10px; +} +.h1, +h1 { + font-size: 60px; +} +.navbar-default .navbar-header .navbar-brand { + color: #a2dfee; +} +/* tag titles */ +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a { + color: #393939; + font-family: 'Arvo', serif; + font-size: 1.5em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 { + color: #525252; + padding-left: 0px; + display: block; + clear: none; + float: left; + font-family: 'Arvo', serif; + font-weight: bold; +} +.navbar-default .navbar-collapse, +.navbar-default .navbar-form { + border-color: #0A0A0A; +} +.container1 { + width: 1500px; + margin: auto; + margin-top: 0; + background-repeat: no-repeat; + background-position: -40px -20px; + margin-bottom: 210px; +} +.container-inner { + width: 1200px; + margin: auto; + background-color: rgba(223, 227, 228, 0.75); + padding-bottom: 40px; + padding-top: 40px; + border-radius: 15px; +} +.header-content { + padding: 0; + width: 1000px; +} +.title1 { + font-size: 80px; + font-family: 'Vollkorn', serif; + color: #404040; + text-align: center; + padding-top: 40px; + padding-bottom: 100px; +} +#icon { + margin-top: -18px; +} +.subtext { + font-size: 25px; + font-style: italic; + color: #08b; + text-align: right; + padding-right: 250px; +} +.bg-primary { + background-color: #00468b; +} +.navbar-default .nav > li > a, +.navbar-default .nav > li > a:focus { + color: #08b; +} +.navbar-default .nav > li > a, +.navbar-default .nav > li > a:hover { + color: #08b; +} +.navbar-default .nav > li > a, +.navbar-default .nav > li > a:focus:hover { + color: #08b; +} +.text-faded { + font-size: 25px; + font-family: 'Vollkorn', serif; +} +.section-heading { + font-family: 'Vollkorn', serif; + font-size: 45px; + padding-bottom: 10px; +} +hr { + border-color: #00468b; + padding-bottom: 10px; +} +.description { + margin-top: 20px; + padding-bottom: 200px; +} +.description li { + font-family: 'Vollkorn', serif; + font-size: 25px; + color: #525252; + margin-left: 28%; + padding-top: 5px; +} +.gap { + margin-top: 200px; +} +.troubleshootingtext { + color: rgba(255, 255, 255, 0.7); + padding-left: 30%; +} +.troubleshootingtext li { + list-style-type: circle; + font-size: 25px; + padding-bottom: 5px; +} +.overlay { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 1000; +} +.block.response_body.json:hover { + cursor: pointer; +} +.backdrop { + color: blue; +} +#myModal { + height: 100%; +} +.modal-backdrop { + bottom: 0; + position: fixed; +} +.curl { + padding: 10px; + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + font-size: 0.9em; + max-height: 400px; + margin-top: 5px; + overflow-y: auto; + background-color: #fcf6db; + border: 1px solid #e5e0c6; + border-radius: 4px; +} +.curl_title { + font-size: 1.1em; + margin: 0; + padding: 15px 0 5px; + font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif; + font-weight: 500; + line-height: 1.1; +} +.footer { + display: none; +} +.swagger-section .swagger-ui-wrap h2 { + padding: 0; +} +h2 { + margin: 0; + margin-bottom: 5px; +} +.markdown p { + font-size: 15px; + font-family: 'Arvo', serif; +} +.swagger-section .swagger-ui-wrap .code { + font-size: 15px; + font-family: 'Arvo', serif; +} +.swagger-section .swagger-ui-wrap b { + font-family: 'Arvo', serif; +} +#signin:hover { + cursor: pointer; +} +.dropdown-menu { + padding: 15px; +} +.navbar-right .dropdown-menu { + left: 0; + right: auto; +} +#signinbutton { + width: 100%; + height: 32px; + font-size: 13px; + font-weight: bold; + color: #08b; +} +.navbar-default .nav > li .details { + color: #000000; + text-transform: none; + font-size: 15px; + font-weight: normal; + font-family: 'Open Sans', sans-serif; + font-style: italic; + line-height: 20px; + top: -2px; +} +.navbar-default .nav > li .details:hover { + color: black; +} +#signout { + width: 100%; + height: 32px; + font-size: 13px; + font-weight: bold; + color: #08b; +} diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/css/typography.css b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/css/typography.css new file mode 100644 index 0000000000000..27c3751ac2ebb --- /dev/null +++ b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/css/typography.css @@ -0,0 +1,26 @@ +/* droid-sans-regular - latin */ +@font-face { + font-family: 'Droid Sans'; + font-style: normal; + font-weight: 400; + src: url('../fonts/droid-sans-v6-latin-regular.eot'); /* IE9 Compat Modes */ + src: local('Droid Sans'), local('DroidSans'), + url('../fonts/droid-sans-v6-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('../fonts/droid-sans-v6-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */ + url('../fonts/droid-sans-v6-latin-regular.woff') format('woff'), /* Modern Browsers */ + url('../fonts/droid-sans-v6-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */ + url('../fonts/droid-sans-v6-latin-regular.svg#DroidSans') format('svg'); /* Legacy iOS */ +} +/* droid-sans-700 - latin */ +@font-face { + font-family: 'Droid Sans'; + font-style: normal; + font-weight: 700; + src: url('../fonts/droid-sans-v6-latin-700.eot'); /* IE9 Compat Modes */ + src: local('Droid Sans Bold'), local('DroidSans-Bold'), + url('../fonts/droid-sans-v6-latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('../fonts/droid-sans-v6-latin-700.woff2') format('woff2'), /* Super Modern Browsers */ + url('../fonts/droid-sans-v6-latin-700.woff') format('woff'), /* Modern Browsers */ + url('../fonts/droid-sans-v6-latin-700.ttf') format('truetype'), /* Safari, Android, iOS */ + url('../fonts/droid-sans-v6-latin-700.svg#DroidSans') format('svg'); /* Legacy iOS */ +} diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-700.eot b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-700.eot new file mode 100644 index 0000000000000..d8524983ad8d2 Binary files /dev/null and b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-700.eot differ diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-700.svg b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-700.svg new file mode 100644 index 0000000000000..a54bbbbf258aa --- /dev/null +++ b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-700.svg @@ -0,0 +1,411 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-700.ttf b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-700.ttf new file mode 100644 index 0000000000000..15896c441fd59 Binary files /dev/null and b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-700.ttf differ diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-700.woff b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-700.woff new file mode 100644 index 0000000000000..67e3e25f8362c Binary files /dev/null and b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-700.woff differ diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-700.woff2 b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-700.woff2 new file mode 100644 index 0000000000000..1e726a7cfce41 Binary files /dev/null and b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-700.woff2 differ diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-regular.eot b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-regular.eot new file mode 100644 index 0000000000000..ac2698e85aee5 Binary files /dev/null and b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-regular.eot differ diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-regular.svg b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-regular.svg new file mode 100644 index 0000000000000..d9f2a214f9629 --- /dev/null +++ b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-regular.svg @@ -0,0 +1,403 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-regular.ttf b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-regular.ttf new file mode 100644 index 0000000000000..fb8cea662b243 Binary files /dev/null and b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-regular.ttf differ diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-regular.woff b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-regular.woff new file mode 100644 index 0000000000000..abf19899f75a0 Binary files /dev/null and b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-regular.woff differ diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-regular.woff2 b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-regular.woff2 new file mode 100644 index 0000000000000..9f93f74c3bede Binary files /dev/null and b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/fonts/droid-sans-v6-latin-regular.woff2 differ diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/images/explorer_icons.png b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/images/explorer_icons.png new file mode 100644 index 0000000000000..ed9d2fffb64a2 Binary files /dev/null and b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/images/explorer_icons.png differ diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/images/favicon-16x16.png b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/images/favicon-16x16.png new file mode 100755 index 0000000000000..66b1a5bfb9ead Binary files /dev/null and b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/images/favicon-16x16.png differ diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/images/favicon-32x32.png b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/images/favicon-32x32.png new file mode 100755 index 0000000000000..32f319f89bd07 Binary files /dev/null and b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/images/favicon-32x32.png differ diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/images/favicon.ico b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/images/favicon.ico new file mode 100755 index 0000000000000..8b60bcf06a768 Binary files /dev/null and b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/images/favicon.ico differ diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/images/logo_small.png b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/images/logo_small.png new file mode 100644 index 0000000000000..5496a65579ae9 Binary files /dev/null and b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/images/logo_small.png differ diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/images/pet_store_api.png b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/images/pet_store_api.png new file mode 100644 index 0000000000000..f9f9cd4aeb35a Binary files /dev/null and b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/images/pet_store_api.png differ diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/images/throbber.gif b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/images/throbber.gif new file mode 100644 index 0000000000000..06393889242fb Binary files /dev/null and b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/images/throbber.gif differ diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/images/wordnik_api.png b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/images/wordnik_api.png new file mode 100644 index 0000000000000..dca4f1455ac45 Binary files /dev/null and b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/images/wordnik_api.png differ diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lang/en.js b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lang/en.js new file mode 100644 index 0000000000000..776a8b72e0d6d --- /dev/null +++ b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lang/en.js @@ -0,0 +1,53 @@ +'use strict'; + +/* jshint quotmark: double */ +window.SwaggerTranslator.learn({ + "Warning: Deprecated":"Warning: Deprecated", + "Implementation Notes":"Implementation Notes", + "Response Class":"Response Class", + "Status":"Status", + "Parameters":"Parameters", + "Parameter":"Parameter", + "Value":"Value", + "Description":"Description", + "Parameter Type":"Parameter Type", + "Data Type":"Data Type", + "Response Messages":"Response Messages", + "HTTP Status Code":"HTTP Status Code", + "Reason":"Reason", + "Response Model":"Response Model", + "Request URL":"Request URL", + "Response Body":"Response Body", + "Response Code":"Response Code", + "Response Headers":"Response Headers", + "Hide Response":"Hide Response", + "Headers":"Headers", + "Try it out!":"Try it out!", + "Show/Hide":"Show/Hide", + "List Operations":"List Operations", + "Expand Operations":"Expand Operations", + "Raw":"Raw", + "can't parse JSON. Raw result":"can't parse JSON. Raw result", + "Model Schema":"Model Schema", + "Model":"Model", + "apply":"apply", + "Username":"Username", + "Password":"Password", + "Terms of service":"Terms of service", + "Created by":"Created by", + "See more at":"See more at", + "Contact the developer":"Contact the developer", + "api version":"api version", + "Response Content Type":"Response Content Type", + "fetching resource":"fetching resource", + "fetching resource list":"fetching resource list", + "Explore":"Explore", + "Show Swagger Petstore Example Apis":"Show Swagger Petstore Example Apis", + "Can't read from server. It may not have the appropriate access-control-origin settings.":"Can't read from server. It may not have the appropriate access-control-origin settings.", + "Please specify the protocol for":"Please specify the protocol for", + "Can't read swagger JSON from":"Can't read swagger JSON from", + "Finished Loading Resource Information. Rendering Swagger UI":"Finished Loading Resource Information. Rendering Swagger UI", + "Unable to read api":"Unable to read api", + "from path":"from path", + "server returned":"server returned" +}); diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lang/es.js b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lang/es.js new file mode 100644 index 0000000000000..a8dff60b6a9bf --- /dev/null +++ b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lang/es.js @@ -0,0 +1,52 @@ +'use strict'; + +/* jshint quotmark: double */ +window.SwaggerTranslator.learn({ + "Warning: Deprecated":"Advertencia: Obsoleto", + "Implementation Notes":"Notas de implementación", + "Response Class":"Clase de la Respuesta", + "Status":"Status", + "Parameters":"Parámetros", + "Parameter":"Parámetro", + "Value":"Valor", + "Description":"Descripción", + "Parameter Type":"Tipo del Parámetro", + "Data Type":"Tipo del Dato", + "Response Messages":"Mensajes de la Respuesta", + "HTTP Status Code":"Código de Status HTTP", + "Reason":"Razón", + "Response Model":"Modelo de la Respuesta", + "Request URL":"URL de la Solicitud", + "Response Body":"Cuerpo de la Respuesta", + "Response Code":"Código de la Respuesta", + "Response Headers":"Encabezados de la Respuesta", + "Hide Response":"Ocultar Respuesta", + "Try it out!":"Pruébalo!", + "Show/Hide":"Mostrar/Ocultar", + "List Operations":"Listar Operaciones", + "Expand Operations":"Expandir Operaciones", + "Raw":"Crudo", + "can't parse JSON. Raw result":"no puede parsear el JSON. Resultado crudo", + "Model Schema":"Esquema del Modelo", + "Model":"Modelo", + "apply":"aplicar", + "Username":"Nombre de usuario", + "Password":"Contraseña", + "Terms of service":"Términos de Servicio", + "Created by":"Creado por", + "See more at":"Ver más en", + "Contact the developer":"Contactar al desarrollador", + "api version":"versión de la api", + "Response Content Type":"Tipo de Contenido (Content Type) de la Respuesta", + "fetching resource":"buscando recurso", + "fetching resource list":"buscando lista del recurso", + "Explore":"Explorar", + "Show Swagger Petstore Example Apis":"Mostrar Api Ejemplo de Swagger Petstore", + "Can't read from server. It may not have the appropriate access-control-origin settings.":"No se puede leer del servidor. Tal vez no tiene la configuración de control de acceso de origen (access-control-origin) apropiado.", + "Please specify the protocol for":"Por favor, especificar el protocola para", + "Can't read swagger JSON from":"No se puede leer el JSON de swagger desde", + "Finished Loading Resource Information. Rendering Swagger UI":"Finalizada la carga del recurso de Información. Mostrando Swagger UI", + "Unable to read api":"No se puede leer la api", + "from path":"desde ruta", + "server returned":"el servidor retornó" +}); diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lang/pt.js b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lang/pt.js new file mode 100644 index 0000000000000..f2e7c13d41378 --- /dev/null +++ b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lang/pt.js @@ -0,0 +1,53 @@ +'use strict'; + +/* jshint quotmark: double */ +window.SwaggerTranslator.learn({ + "Warning: Deprecated":"Aviso: Depreciado", + "Implementation Notes":"Notas de Implementação", + "Response Class":"Classe de resposta", + "Status":"Status", + "Parameters":"Parâmetros", + "Parameter":"Parâmetro", + "Value":"Valor", + "Description":"Descrição", + "Parameter Type":"Tipo de parâmetro", + "Data Type":"Tipo de dados", + "Response Messages":"Mensagens de resposta", + "HTTP Status Code":"Código de status HTTP", + "Reason":"Razão", + "Response Model":"Modelo resposta", + "Request URL":"URL requisição", + "Response Body":"Corpo da resposta", + "Response Code":"Código da resposta", + "Response Headers":"Cabeçalho da resposta", + "Headers":"Cabeçalhos", + "Hide Response":"Esconder resposta", + "Try it out!":"Tente agora!", + "Show/Hide":"Mostrar/Esconder", + "List Operations":"Listar operações", + "Expand Operations":"Expandir operações", + "Raw":"Cru", + "can't parse JSON. Raw result":"Falha ao analisar JSON. Resulto cru", + "Model Schema":"Modelo esquema", + "Model":"Modelo", + "apply":"Aplicar", + "Username":"Usuário", + "Password":"Senha", + "Terms of service":"Termos do serviço", + "Created by":"Criado por", + "See more at":"Veja mais em", + "Contact the developer":"Contate o desenvolvedor", + "api version":"Versão api", + "Response Content Type":"Tipo de conteúdo da resposta", + "fetching resource":"busca recurso", + "fetching resource list":"buscando lista de recursos", + "Explore":"Explorar", + "Show Swagger Petstore Example Apis":"Show Swagger Petstore Example Apis", + "Can't read from server. It may not have the appropriate access-control-origin settings.":"Não é possível ler do servidor. Pode não ter as apropriadas configurações access-control-origin", + "Please specify the protocol for":"Por favor especifique o protocolo", + "Can't read swagger JSON from":"Não é possível ler o JSON Swagger de", + "Finished Loading Resource Information. Rendering Swagger UI":"Carregar informação de recurso finalizada. Renderizando Swagger UI", + "Unable to read api":"Não foi possível ler api", + "from path":"do caminho", + "server returned":"servidor retornou" +}); diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lang/ru.js b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lang/ru.js new file mode 100644 index 0000000000000..065100f73f99c --- /dev/null +++ b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lang/ru.js @@ -0,0 +1,52 @@ +'use strict'; + +/* jshint quotmark: double */ +window.SwaggerTranslator.learn({ + "Warning: Deprecated":"Ворнинг: Депрекейтед", + "Implementation Notes":"Заметки", + "Response Class":"Пример ответа", + "Status":"Статус", + "Parameters":"Параметры", + "Parameter":"Параметр", + "Value":"Значение", + "Description":"Описание", + "Parameter Type":"Тип параметра", + "Data Type":"Тип данных", + "HTTP Status Code":"HTTP код", + "Reason":"Причина", + "Response Model":"Структура ответа", + "Request URL":"URL запроса", + "Response Body":"Тело ответа", + "Response Code":"HTTP код ответа", + "Response Headers":"Заголовки ответа", + "Hide Response":"Спрятать ответ", + "Response Messages":"Что может прийти в ответ", + "Try it out!":"Попробовать!", + "Show/Hide":"Показать/Скрыть", + "List Operations":"Операции кратко", + "Expand Operations":"Операции подробно", + "Raw":"В сыром виде", + "can't parse JSON. Raw result":"Не удается распарсить ответ:", + "Model Schema":"Структура", + "Model":"Описание", + "apply":"применить", + "Username":"Имя пользователя", + "Password":"Пароль", + "Terms of service":"Условия использования", + "Created by":"Разработано", + "See more at":"Еще тут", + "Contact the developer":"Связаться с разработчиком", + "api version":"Версия API", + "Response Content Type":"Content Type ответа", + "fetching resource":"Получение ресурса", + "fetching resource list":"Получение ресурсов", + "Explore":"Поехали", + "Show Swagger Petstore Example Apis":"Показать примеры АПИ", + "Can't read from server. It may not have the appropriate access-control-origin settings.":"Не удается получить ответ от сервера. Возможно, какая-то лажа с настройками доступа", + "Please specify the protocol for":"Пожалуйста, укажите протогол для", + "Can't read swagger JSON from":"Не получается прочитать swagger json из", + "Finished Loading Resource Information. Rendering Swagger UI":"Загрузка информации о ресурсах завершена. Рендерим", + "Unable to read api":"Не удалось прочитать api", + "from path":"по адресу", + "server returned":"сервер сказал" +}); diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lang/translator.js b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lang/translator.js new file mode 100644 index 0000000000000..591f6d409430a --- /dev/null +++ b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lang/translator.js @@ -0,0 +1,39 @@ +'use strict'; + +/** + * Translator for documentation pages. + * + * To enable translation you should include one of language-files in your index.html + * after . + * For example - + * + * If you wish to translate some new texsts you should do two things: + * 1. Add a new phrase pair ("New Phrase": "New Translation") into your language file (for example lang/ru.js). It will be great if you add it in other language files too. + * 2. Mark that text it templates this way New Phrase or . + * The main thing here is attribute data-sw-translate. Only inner html, title-attribute and value-attribute are going to translate. + * + */ +window.SwaggerTranslator = { + + _words:[], + + translate: function(sel) { + var $this = this; + sel = sel || '[data-sw-translate]'; + + $(sel).each(function() { + $(this).html($this._tryTranslate($(this).html())); + + $(this).val($this._tryTranslate($(this).val())); + $(this).attr('title', $this._tryTranslate($(this).attr('title'))); + }); + }, + + _tryTranslate: function(word) { + return this._words[$.trim(word)] !== undefined ? this._words[$.trim(word)] : word; + }, + + learn: function(wordsMap) { + this._words = wordsMap; + } +}; diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lib/backbone-min.js b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lib/backbone-min.js new file mode 100644 index 0000000000000..a3f544be6d9e8 --- /dev/null +++ b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lib/backbone-min.js @@ -0,0 +1,15 @@ +// Backbone.js 1.1.2 + +(function(t,e){if(typeof define==="function"&&define.amd){define(["underscore","jquery","exports"],function(i,r,s){t.Backbone=e(t,s,i,r)})}else if(typeof exports!=="undefined"){var i=require("underscore");e(t,exports,i)}else{t.Backbone=e(t,{},t._,t.jQuery||t.Zepto||t.ender||t.$)}})(this,function(t,e,i,r){var s=t.Backbone;var n=[];var a=n.push;var o=n.slice;var h=n.splice;e.VERSION="1.1.2";e.$=r;e.noConflict=function(){t.Backbone=s;return this};e.emulateHTTP=false;e.emulateJSON=false;var u=e.Events={on:function(t,e,i){if(!c(this,"on",t,[e,i])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);r.push({callback:e,context:i,ctx:i||this});return this},once:function(t,e,r){if(!c(this,"once",t,[e,r])||!e)return this;var s=this;var n=i.once(function(){s.off(t,n);e.apply(this,arguments)});n._callback=e;return this.on(t,n,r)},off:function(t,e,r){var s,n,a,o,h,u,l,f;if(!this._events||!c(this,"off",t,[e,r]))return this;if(!t&&!e&&!r){this._events=void 0;return this}o=t?[t]:i.keys(this._events);for(h=0,u=o.length;h").attr(t);this.setElement(r,false)}else{this.setElement(i.result(this,"el"),false)}}});e.sync=function(t,r,s){var n=T[t];i.defaults(s||(s={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:n,dataType:"json"};if(!s.url){a.url=i.result(r,"url")||M()}if(s.data==null&&r&&(t==="create"||t==="update"||t==="patch")){a.contentType="application/json";a.data=JSON.stringify(s.attrs||r.toJSON(s))}if(s.emulateJSON){a.contentType="application/x-www-form-urlencoded";a.data=a.data?{model:a.data}:{}}if(s.emulateHTTP&&(n==="PUT"||n==="DELETE"||n==="PATCH")){a.type="POST";if(s.emulateJSON)a.data._method=n;var o=s.beforeSend;s.beforeSend=function(t){t.setRequestHeader("X-HTTP-Method-Override",n);if(o)return o.apply(this,arguments)}}if(a.type!=="GET"&&!s.emulateJSON){a.processData=false}if(a.type==="PATCH"&&k){a.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}var h=s.xhr=e.ajax(i.extend(a,s));r.trigger("request",r,h,s);return h};var k=typeof window!=="undefined"&&!!window.ActiveXObject&&!(window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent);var T={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var $=e.Router=function(t){t||(t={});if(t.routes)this.routes=t.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var S=/\((.*?)\)/g;var H=/(\(\?)?:\w+/g;var A=/\*\w+/g;var I=/[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend($.prototype,u,{initialize:function(){},route:function(t,r,s){if(!i.isRegExp(t))t=this._routeToRegExp(t);if(i.isFunction(r)){s=r;r=""}if(!s)s=this[r];var n=this;e.history.route(t,function(i){var a=n._extractParameters(t,i);n.execute(s,a);n.trigger.apply(n,["route:"+r].concat(a));n.trigger("route",r,a);e.history.trigger("route",n,r,a)});return this},execute:function(t,e){if(t)t.apply(this,e)},navigate:function(t,i){e.history.navigate(t,i);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=i.result(this,"routes");var t,e=i.keys(this.routes);while((t=e.pop())!=null){this.route(t,this.routes[t])}},_routeToRegExp:function(t){t=t.replace(I,"\\$&").replace(S,"(?:$1)?").replace(H,function(t,e){return e?t:"([^/?]+)"}).replace(A,"([^?]*?)");return new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return i.map(r,function(t,e){if(e===r.length-1)return t||null;return t?decodeURIComponent(t):null})}});var N=e.History=function(){this.handlers=[];i.bindAll(this,"checkUrl");if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var R=/^[#\/]|\s+$/g;var O=/^\/+|\/+$/g;var P=/msie [\w.]+/;var C=/\/$/;var j=/#.*$/;N.started=false;i.extend(N.prototype,u,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(t==null){if(this._hasPushState||!this._wantsHashChange||e){t=decodeURI(this.location.pathname+this.location.search);var i=this.root.replace(C,"");if(!t.indexOf(i))t=t.slice(i.length)}else{t=this.getHash()}}return t.replace(R,"")},start:function(t){if(N.started)throw new Error("Backbone.history has already been started");N.started=true;this.options=i.extend({root:"/"},this.options,t);this.root=this.options.root;this._wantsHashChange=this.options.hashChange!==false;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var r=this.getFragment();var s=document.documentMode;var n=P.exec(navigator.userAgent.toLowerCase())&&(!s||s<=7);this.root=("/"+this.root+"/").replace(O,"/");if(n&&this._wantsHashChange){var a=e.$('