Author: johnnyoffline
Date: 2010-01-11 22:16:35 +0100 (Mon, 11 Jan 2010)
New Revision: 26489

Modified:
   
plugins/pkContextCMSPlugin/trunk/modules/pkContextCMS/templates/_renamePage.php
Log:
Fixed bug where javascript was being output for admin specific scenarios that 
shouldn't be there. Also enhanced slideshow to display the first image if 
nojavascript

Modified: 
plugins/pkContextCMSPlugin/trunk/modules/pkContextCMS/templates/_renamePage.php
===================================================================
--- 
plugins/pkContextCMSPlugin/trunk/modules/pkContextCMS/templates/_renamePage.php 
    2010-01-11 18:28:14 UTC (rev 26488)
+++ 
plugins/pkContextCMSPlugin/trunk/modules/pkContextCMS/templates/_renamePage.php 
    2010-01-11 21:16:35 UTC (rev 26489)
@@ -21,85 +21,85 @@
 
   </form>
 
-<?php else: ?>
+       <script type="text/javascript" charset="utf-8">
+               $(document).ready(function() {
 
-  <?php echo $page->getTitle() ?>
+                       var renameForm = $('.pk-breadcrumb-form.rename')
+                       renameForm.prepend('<b 
class="pk-breadcrumb-rename-title-spacer" 
style="display:none;float:left;white-space:nowrap;"><?php echo 
$page->getTitle() ?></b>')
 
-<?php endif ?>
+                       var renameControls = 
$('#pk-breadcrumb-rename-controls');
+                       var renameSpacer = 
$('.pk-breadcrumb-rename-title-spacer');
+                       var renameInput = $('#pk-breadcrumb-rename-title');
+                       var renameInputWidth = 
checkInputWidth(renameSpacer.width());           
+                       renameInput.css('width', renameInputWidth);             
 
-<script type="text/javascript" charset="utf-8">
-       $(document).ready(function() {
-               
-               var renameForm = $('.pk-breadcrumb-form.rename')
-               renameForm.prepend('<b 
class="pk-breadcrumb-rename-title-spacer" 
style="display:none;float:left;white-space:nowrap;"><?php echo 
$page->getTitle() ?></b>')
-
-               var renameControls = $('#pk-breadcrumb-rename-controls');
-               var renameSpacer = $('.pk-breadcrumb-rename-title-spacer');
-               var renameInput = $('#pk-breadcrumb-rename-title');
-               var renameInputWidth = checkInputWidth(renameSpacer.width());   
        
-               renameInput.css('width', renameInputWidth);             
-               
-               var currentTitle = "<?php echo $page->getTitle() ?>";
-               renameInput[0].value = currentTitle;
-               var liveTitle = renameInput[0].value;
-               
-                                       
-               renameInput.bind('cancel', function(e){
-                       renameSpacer.text(currentTitle)
+                       var currentTitle = "<?php echo $page->getTitle() ?>";
                        renameInput[0].value = currentTitle;
-                       renameInputWidth = 
checkInputWidth(renameSpacer.width());
-                       renameInput.css('width', renameInputWidth);
-                       renameControls.hide();
-                       renameInput.blur();
-               });
-               
-               renameInput.focus(function(){
-                       renameControls.fadeIn();
-                       renameInput.select();
-               })
-               
-               renameInput.blur(function(){
-                       renameControls.hide();
-               })
-               
-               renameInput.keydown(function(e){
-                       liveTitle = renameInput[0].value;
-                       renameSpacer.text(liveTitle);
-               });
+                       var liveTitle = renameInput[0].value;
 
-               renameInput.keyup(function(e){
-                       if ($.charcode(e) == 'escape')
-                       {
+
+                       renameInput.bind('cancel', function(e){
+                               renameSpacer.text(currentTitle)
+                               renameInput[0].value = currentTitle;
+                               renameInputWidth = 
checkInputWidth(renameSpacer.width());
+                               renameInput.css('width', renameInputWidth);
+                               renameControls.hide();
+                               renameInput.blur();
+                       });
+
+                       renameInput.focus(function(){
+                               renameControls.fadeIn();
+                               renameInput.select();
+                       })
+
+                       renameInput.blur(function(){
+                               renameControls.hide();
+                       })
+
+                       renameInput.keydown(function(e){
+                               liveTitle = renameInput[0].value;
+                               renameSpacer.text(liveTitle);
+                       });
+
+                       renameInput.keyup(function(e){
+                               if ($.charcode(e) == 'escape')
+                               {
+                                       renameInput.trigger('cancel');
+                               }                       
+                               renameInputWidth = 
checkInputWidth(renameSpacer.width());
+                               renameInput.css('width', renameInputWidth);
+                       });
+
+                       renameControls.find('.pk-cancel').click(function(){
                                renameInput.trigger('cancel');
-                       }                       
-                       renameInputWidth = 
checkInputWidth(renameSpacer.width());
-                       renameInput.css('width', renameInputWidth);
-               });
-               
-               renameControls.find('.pk-cancel').click(function(){
-                       renameInput.trigger('cancel');
-               });
-               
-               function checkInputWidth(w)
-               {
-                       var minWidth = 50;
-                       var maxWidth = 250;
-                       if (w < minWidth)
+                       });
+
+                       function checkInputWidth(w)
                        {
-                               return minWidth;
-                       } 
-                       else if (w > maxWidth)
-                       {
-                               // we are not enforcing maxWidth at the moment;
-                               // return maxWidth;
-                               return w;
+                               var minWidth = 50;
+                               var maxWidth = 250;
+                               if (w < minWidth)
+                               {
+                                       return minWidth;
+                               } 
+                               else if (w > maxWidth)
+                               {
+                                       // we are not enforcing maxWidth at the 
moment;
+                                       // return maxWidth;
+                                       return w;
+                               }
+                               else
+                               {
+                                       return w;
+                               }
                        }
-                       else
-                       {
-                               return w;
-                       }
-               }
-               
-       });
-       
-</script>
\ No newline at end of file
+
+               });
+
+       </script>
+
+<?php else: ?>
+
+  <?php echo $page->getTitle() ?>
+
+<?php endif ?>
\ No newline at end of file

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.


Reply via email to