Changeset 2167
- Timestamp:
- 09/09/10 14:44:56 (17 months ago)
- Location:
- plugins/apostrophePlugin/trunk
- Files:
-
- 7 modified
-
modules/a/templates/_area.php (modified) (2 diffs)
-
modules/a/templates/_createPage.php (modified) (1 diff)
-
modules/a/templates/_globalTools.php (modified) (1 diff)
-
modules/a/templates/_simpleEditWithVariants.php (modified) (1 diff)
-
modules/a/templates/_slot.php (modified) (1 diff)
-
modules/a/templates/_variant.php (modified) (2 diffs)
-
web/js/a.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
plugins/apostrophePlugin/trunk/modules/a/templates/_area.php
r2164 r2167 11 11 $slots = isset($slots) ? $sf_data->getRaw('slots') : null; 12 12 ?> 13 <?php use_helper('a', 'jQuery', 'I18N') ?> 13 14 <?php use_helper('a') ?> 14 15 15 16 <?php slot('a-history-controls') ?> … … 172 173 }); 173 174 </script> 174 <?php a_js_call('apostrophe.areaUpdateMoveButtons(?, ?, ?)', url_for('a/moveSlot'), $pageid, $name) ?> 175 <?php a_js_call('apostrophe.menuToggle(?)', array('button' => '#a-add-slot-'.$pageid.'-'.$name, 'classname' => 'a-options-open', 'overlay' => false)) ?> 175 176 <?php if ($infinite): ?> 177 <?php a_js_call('apostrophe.areaUpdateMoveButtons(?, ?, ?)', url_for('a/moveSlot'), $pageid, $name) ?> 178 <?php a_js_call('apostrophe.menuToggle(?)', array('button' => '#a-add-slot-'.$pageid.'-'.$name, 'classname' => 'a-options-open', 'overlay' => false)) ?> 176 179 <?php endif ?> 180 181 <?php endif ?> -
plugins/apostrophePlugin/trunk/modules/a/templates/_createPage.php
r2160 r2167 3 3 $form = isset($form) ? $sf_data->getRaw('form') : null; 4 4 ?> 5 <?php use_helper('I18N') ?>6 5 7 <a href="#" class="a-btn icon a-add a-create-page" id="a-create-page-button" onclick="return false;"><span class="icon"></span><?php echo __("Add Page", null, 'apostrophe') ?></a> 6 <?php use_helper('a') ?> 7 8 <a href="#add-page" class="a-btn icon a-add a-create-page" id="a-create-page-button" onclick="return false;"><span class="icon"></span><?php echo __("Add Page", null, 'apostrophe') ?></a> 8 9 9 10 <form method="POST" action="<?php echo url_for('a/create') ?>" id="a-create-page-form" class="a-ui a-options a-page-form a-create-page-form dropshadow"> -
plugins/apostrophePlugin/trunk/modules/a/templates/_globalTools.php
r2135 r2167 1 <?php use_helper(' I18N') ?>1 <?php use_helper('a') ?> 2 2 3 3 <?php $buttons = aTools::getGlobalButtons() ?> -
plugins/apostrophePlugin/trunk/modules/a/templates/_simpleEditWithVariants.php
r2139 r2167 16 16 17 17 <?php include_partial('a/simpleEditButton', array('pageid' => $pageid, 'slot' => $slot, 'name' => $name, 'permid' => $permid, 'controlsSlot' => false)) ?> 18 19 18 <?php include_partial('a/variant', array('pageid' => $pageid, 'name' => $name, 'permid' => $permid, 'slot' => $slot)) ?> 20 19 -
plugins/apostrophePlugin/trunk/modules/a/templates/_slot.php
r2164 r2167 17 17 $validationData = isset($validationData) ? $sf_data->getRaw('validationData') : null; 18 18 ?> 19 <?php use_helper(' jQuery', 'I18N') ?>19 <?php use_helper('a') ?> 20 20 21 21 <?php // We now render the edit view only when it is AJAXed into place on demand. This saves us the ?> -
plugins/apostrophePlugin/trunk/modules/a/templates/_variant.php
r2160 r2167 6 6 $slot = isset($slot) ? $sf_data->getRaw('slot') : null; 7 7 ?> 8 <?php use_helper('I18N') ?> 8 9 <?php use_helper('a') ?> 10 9 11 <?php $options = $sf_user->getAttribute("slot-options-$pageid-$name-$permid", null, 'apostrophe') ?> 10 12 <?php $variants = aTools::getVariantsForSlotType($slot->type, $options) ?> … … 48 50 </ul> 49 51 </li> 52 53 <?php if (!$slot->isNew()): ?> 54 <?php a_js_call('apostrophe.menuToggle(?)', array('button' => '#a-'.$pageid.'-'.$name.'-'.$permid.'-variant-options-toggle', 'classname' => 'a-options-open', 'overlay' => false)) ?> 55 <?php endif ?> 56 50 57 <?php endif ?> 51 52 <?php a_js_call('apostrophe.menuToggle(?)', array('button' => '#a-'.$pageid.'-'.$name.'-'.$permid.'-variant-options-toggle', 'classname' => 'a-options-open', 'overlay' => false)) ?> -
plugins/apostrophePlugin/trunk/web/js/a.js
r2162 r2167 469 469 var aPageSettingsButton = $('#a-page-settings-button'); 470 470 471 _menuToggle('#a-page-settings-button', '', true);472 471 apostrophe.menuToggle({"button":"#a-page-settings-button","classname":"","overlay":true}) 472 473 473 aPageSettingsButton.click(function() { 474 474 $.ajax({ … … 638 638 var classname = options['classname']; 639 639 var overlay = options['overlay']; 640 _menuToggle(button, classname, overlay); 641 } 642 643 644 function _menuToggle(button, classname, overlay) 640 641 if (typeof(button) == "undefined") { 642 apostrophe.log('[Apostrophe] menuToggle button is undefined'); 643 } 644 else 645 { 646 if (typeof button == "string") { button = $(button); } /* button that toggles the menu open & closed */ 647 if (typeof classname == "undefined" || classname == '') { classname = "show-options"; } /* optional classname override to use for toggle & styling */ 648 if (typeof overlay != "undefined" && overlay) { overlay = $('.a-page-overlay'); } /* optional full overlay */ 649 650 // Use the parent of the button as the menu container 651 var menu = $(button).parent(); 652 if (typeof(menu) == "object") { 653 _menuToggle(button, menu, classname, overlay); 654 }; 655 }; 656 } 657 658 function _menuToggle(button, menu, classname, overlay) 645 659 { 646 /* Usage: aMenuToggle(Object|ID Selector, Object|ID Selector, Undefined|String, Undefined|True|False) */ 647 648 if (typeof button == "string") { button = $(button); } /* button that toggles the menu open & closed */ 649 if (typeof classname == "undefined" || classname == '') { classname = "show-options"; } /* optional classname override to use for toggle & styling */ 650 if (typeof overlay != "undefined" && overlay) { overlay = $('.a-page-overlay'); } /* optional full overlay */ 651 var menu = $(button).parent(); // Use the parent of the button as the menu container 652 653 // We need an ID for the menu. If the menu doesn't have one, we create it by appending 'menu' to the Button ID 654 if (menu.attr('id') == '') { 660 // Menu must have an ID. 661 // If the menu doesn't have one, we create it by appending 'menu' to the Button ID 662 if (menu.attr('id') == '') 663 { 655 664 newID = button.attr('id')+'-menu'; 656 665 menu.attr('id', newID).addClass('a-options-container'); … … 667 676 menu.trigger('toggleClosed'); 668 677 } 669 }) ;678 }).addClass('a-options-button'); 670 679 671 680 // Open Menu, Create Listener … … 674 683 menu.addClass(classname); 675 684 if (overlay) { overlay.stop().show(); } 676 $(document).click(function(e ){677 var target = $(e .target);685 $(document).click(function(event){ 686 var target = $(event.target); 678 687 if (target.hasClass('.a-page-overlay') || target.hasClass('.a-cancel')) 679 688 { … … 691 700 button.removeClass('aActiveMenu'); 692 701 menu.removeClass(classname); 693 if (overlay) { overlay.fadeOut(); } 702 if (overlay) { overlay.fadeOut(); }; 694 703 $(document).unbind('click'); // Clear out click event 695 704 }); 696 705 697 $('.a-options-cancel').live('click', function(){ 698 // console.log(menu); 699 $(this).closest(menu).trigger('toggleClosed'); 706 menu.click(function(event){ 707 target = $(event.target); 708 if (target.hasClass('a-options-cancel')) 709 { 710 menu.trigger('toggleClosed'); 711 }; 700 712 }); 701 713

