Permalink
Browse files

Update as of 9/27/2012

* Refactoring Magento 2 to use jQuery instead of Prototype:
  * Implemented simple lazy-loading functionality
  * Converted decorator mechanism to jQuery
  * Moved Installation process to jQuery
  * Moved Home, Category and Simple Product View pages to jQuery
  * Moved all frontend libraries from `pub/js` directory to `pub/lib`
* Improved Javascript unit tests to be consistent with other test frameworks in Magento
* Added Javascript code analysis tests to the static tests suite
* Added jQuery file uploader for admin backend, cleaned out old deprecated uploaders
* Implemented fixture of 100k orders for the performance tests
* Fixes
  * Admin menu elements order differs for a cached page and non-cached one
  * Typos in System > Configuration > General Tab
  * Wrong elements positions on "View Order" page
  * Impossible to configure checkout on store scope
  * Warning message in `system.log` when using GD2 image adapter
  * "Preview" link is absent for managing CMS Pages in single store mode
  * "Promotions" tab is missing on Configuration page
  * Wrong format of performance tests config
  • Loading branch information...
1 parent da072ba commit 215c077c2187ccc70703823978182f861cedd58a @magento-team magento-team committed Sep 27, 2012
Showing 1,532 changed files with 106,285 additions and 96,293 deletions.
View
@@ -34,3 +34,4 @@ atlassian*
dev/api-tests/config.php
dev/api-tests/integration/tmp/*
dev/api-tests/integration/framework/local-mysql.xml
+
View
@@ -1,3 +1,25 @@
+Update as of 9/27/2012
+======================
+* Refactoring Magento 2 to use jQuery instead of Prototype:
+ * Implemented simple lazy-loading functionality
+ * Converted decorator mechanism to jQuery
+ * Moved Installation process to jQuery
+ * Moved Home, Category and Simple Product View pages to jQuery
+ * Moved all frontend libraries from `pub/js` directory to `pub/lib`
+* Improved Javascript unit tests to be consistent with other test frameworks in Magento
+* Added Javascript code analysis tests to the static tests suite
+* Added jQuery file uploader for admin backend, cleaned out old deprecated uploaders
+* Implemented fixture of 100k orders for the performance tests
+* Fixes
+ * Admin menu elements order differs for a cached page and non-cached one
+ * Typos in System > Configuration > General Tab
+ * Wrong elements positions on "View Order" page
+ * Impossible to configure checkout on store scope
+ * Warning message in `system.log` when using GD2 image adapter
+ * "Preview" link is absent for managing CMS Pages in single store mode
+ * "Promotions" tab is missing on Configuration page
+ * Wrong format of performance tests config
+
Update as of 9/13/2012
======================
* Implemented the option to enable the single store mode in the system configuration, which simplifies the back-end GUI:
@@ -38,7 +38,6 @@ class Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery extends Varien_Da
public function getElementHtml()
{
$html = $this->getContentHtml();
- //$html.= $this->getAfterElementHtml();
return $html;
}
@@ -54,8 +53,9 @@ public function getContentHtml()
$content = Mage::getSingleton('Mage_Core_Model_Layout')
->createBlock('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery_Content');
- $content->setId($this->getHtmlId() . '_content')
- ->setElement($this);
+ $content->setId($this->getHtmlId() . '_content')->setElement($this);
+ $galleryJs = $content->getJsObjectName();
+ $content->getUploader()->getConfig()->setMegiaGallery($galleryJs);
return $content->toHtml();
}
@@ -1,151 +0,0 @@
-<?php
-/**
- * Magento
- *
- * NOTICE OF LICENSE
- *
- * This source file is subject to the Open Software License (OSL 3.0)
- * that is bundled with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://opensource.org/licenses/osl-3.0.php
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@magentocommerce.com so we can send you a copy immediately.
- *
- * DISCLAIMER
- *
- * Do not edit or add to this file if you wish to upgrade Magento to newer
- * versions in the future. If you wish to customize Magento for your
- * needs please refer to http://www.magentocommerce.com for more information.
- *
- * @category Mage
- * @package Mage_Adminhtml
- * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
- */
-
-
-/**
- * Adminhtml media library image editor
- *
- * @category Mage
- * @package Mage_Adminhtml
- * @author Magento Core Team <core@magentocommerce.com>
- */
-class Mage_Adminhtml_Block_Media_Editor extends Mage_Adminhtml_Block_Widget
-{
-
- protected $_config;
-
- public function __construct()
- {
- parent::__construct();
- $this->setTemplate('media/editor.phtml');
- $this->getConfig()->setParams();
- }
-
- protected function _prepareLayout()
- {
- $this->setChild(
- 'rotatecw_button',
- $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')
- ->addData(array(
- 'id' => $this->_getButtonId('rotatecw'),
- 'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Rotate CW'),
- 'onclick' => $this->getJsObjectName() . '.rotateCw()'
- ))
- );
-
- $this->setChild(
- 'rotateccw_button',
- $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')
- ->addData(array(
- 'id' => $this->_getButtonId('rotateccw'),
- 'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Rotate CCW'),
- 'onclick' => $this->getJsObjectName() . '.rotateCCw()'
- ))
- );
-
- $this->setChild(
- 'resize_button',
- $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')
- ->addData(array(
- 'id' => $this->_getButtonId('upload'),
- 'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Resize'),
- 'onclick' => $this->getJsObjectName() . '.resize()'
- ))
- );
-
- $this->setChild(
- 'image_button',
- $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')
- ->addData(array(
- 'id' => $this->_getButtonId('image'),
- 'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Get Image Base64'),
- 'onclick' => $this->getJsObjectName() . '.getImage()'
- ))
- );
-
- return parent::_prepareLayout();
- }
-
- protected function _getButtonId($buttonName)
- {
- return $this->getHtmlId() . '-' . $buttonName;
- }
-
- public function getRotatecwButtonHtml()
- {
- return $this->getChildHtml('rotatecw_button');
- }
-
- public function getImageButtonHtml()
- {
- return $this->getChildHtml('image_button');
- }
-
- public function getRotateccwButtonHtml()
- {
- return $this->getChildHtml('rotateccw_button');
- }
-
- public function getResizeButtonHtml()
- {
- return $this->getChildHtml('resize_button');
- }
-
- /**
- * Retrive uploader js object name
- *
- * @return string
- */
- public function getJsObjectName()
- {
- return $this->getHtmlId() . 'JsObject';
- }
-
- /**
- * Retrive config json
- *
- * @return string
- */
- public function getConfigJson()
- {
- return Mage::helper('Mage_Core_Helper_Data')->jsonEncode($this->getConfig()->getData());
- }
-
- /**
- * Retrive config object
- *
- * @return Varien_Config
- */
- public function getConfig()
- {
- if(is_null($this->_config)) {
- $this->_config = new Varien_Object();
- }
-
- return $this->_config;
- }
-
-}
@@ -60,65 +60,20 @@ public function __construct()
));
}
+ /**
+ * Prepares layout and set element renderer
+ *
+ * @return Mage_Adminhtml_Block_Media_Uploader
+ */
protected function _prepareLayout()
{
- $this->setChild(
- 'browse_button',
- $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')
- ->addData(array(
- 'id' => $this->_getButtonId('browse'),
- 'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Browse Files...'),
- 'type' => 'button',
- 'onclick' => $this->getJsObjectName() . '.browse()'
- ))
- );
-
- $this->setChild(
- 'upload_button',
- $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')
- ->addData(array(
- 'id' => $this->_getButtonId('upload'),
- 'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Upload Files'),
- 'type' => 'button',
- 'onclick' => $this->getJsObjectName() . '.upload()'
- ))
- );
-
- $this->setChild(
- 'delete_button',
- $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')
- ->addData(array(
- 'id' => '{{id}}-delete',
- 'class' => 'delete',
- 'type' => 'button',
- 'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Remove'),
- 'onclick' => $this->getJsObjectName() . '.removeFile(\'{{fileId}}\')'
- ))
- );
-
+ $head = $this->getLayout()->getBlock('head');
+ if ($head) {
+ $head->addCss('Mage_Adminhtml::jquery/fileUploader/css/jquery.fileupload-ui.css');
+ }
return parent::_prepareLayout();
}
- protected function _getButtonId($buttonName)
- {
- return $this->getHtmlId() . '-' . $buttonName;
- }
-
- public function getBrowseButtonHtml()
- {
- return $this->getChildHtml('browse_button');
- }
-
- public function getUploadButtonHtml()
- {
- return $this->getChildHtml('upload_button');
- }
-
- public function getDeleteButtonHtml()
- {
- return $this->getChildHtml('delete_button');
- }
-
/**
* Retrive uploader js object name
*
@@ -1,52 +0,0 @@
-<?php
-/**
- * Magento
- *
- * NOTICE OF LICENSE
- *
- * This source file is subject to the Open Software License (OSL 3.0)
- * that is bundled with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://opensource.org/licenses/osl-3.0.php
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@magentocommerce.com so we can send you a copy immediately.
- *
- * DISCLAIMER
- *
- * Do not edit or add to this file if you wish to upgrade Magento to newer
- * versions in the future. If you wish to customize Magento for your
- * needs please refer to http://www.magentocommerce.com for more information.
- *
- * @category Mage
- * @package Mage_Adminhtml
- * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
- */
-
-
-/**
- * Media library editor controller
- *
- * @category Mage
- * @package Mage_Adminhtml
- * @author Magento Core Team <core@magentocommerce.com>
- */
-class Mage_Adminhtml_Media_EditorController extends Mage_Adminhtml_Controller_Action
-{
- public function indexAction()
- {
- $this->loadLayout();
- $this->_addContent(
- $this->getLayout()->createBlock('Mage_Adminhtml_Block_Media_Editor')
- );
- $this->renderLayout();
- }
-
- protected function _isAllowed()
- {
- return Mage::getSingleton('Mage_Core_Model_Authorization')->isAllowed(
- Mage_Backend_Model_Acl_Config::ACL_RESOURCE_ALL
- );
- }
-}
@@ -1,56 +0,0 @@
-<?php
-/**
- * Magento
- *
- * NOTICE OF LICENSE
- *
- * This source file is subject to the Open Software License (OSL 3.0)
- * that is bundled with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://opensource.org/licenses/osl-3.0.php
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@magentocommerce.com so we can send you a copy immediately.
- *
- * DISCLAIMER
- *
- * Do not edit or add to this file if you wish to upgrade Magento to newer
- * versions in the future. If you wish to customize Magento for your
- * needs please refer to http://www.magentocommerce.com for more information.
- *
- * @category Mage
- * @package Mage_Adminhtml
- * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
- */
-
-/**
- * Media library upload controller
- *
- * @category Mage
- * @package Mage_Adminhtml
- * @author Magento Core Team <core@magentocommerce.com>
- */
-class Mage_Adminhtml_Media_UploaderController extends Mage_Adminhtml_Controller_Action
-{
-
- public function uploadAction()
- {
- $this->getResponse()->setBody(Mage::helper('Mage_Core_Helper_Data')->jsonEncode($_REQUEST));
- }
-
- public function indexAction()
- {
- $this->loadLayout();
- $this->_addContent(
- $this->getLayout()->createBlock('Mage_Adminhtml_Block_Media_Uploader')
- );
- $this->renderLayout();
- }
-
- protected function _isAllowed()
- {
- return Mage::getSingleton('Mage_Core_Model_Authorization')
- ->isAllowed(Mage_Backend_Model_Acl_Config::ACL_RESOURCE_ALL);
- }
-}
Oops, something went wrong. Retry.

0 comments on commit 215c077

Please sign in to comment.