Author: ornicar2
Date: 2010-02-12 21:51:30 +0100 (Fri, 12 Feb 2010)
New Revision: 27981

Modified:
   plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreCodeArea.js
   plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreConfig.js
   plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreCtrl.js
   plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreEditCtrl.js
   plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreEditPlugins.js
   plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreMarkdown.js
   plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCorePageBar.js
   plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCorePlugins.js
   plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreTabForm.js
   plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreToolBar.js
Log:
[Diem] complete previous commit

Modified: plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreCodeArea.js
===================================================================
--- plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreCodeArea.js      
2010-02-12 20:47:27 UTC (rev 27980)
+++ plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreCodeArea.js      
2010-02-12 20:51:30 UTC (rev 27981)
@@ -15,14 +15,14 @@
       var self = this;
       
       this.element.css({
-                               'fontFamily': 'monospace',
-                         'fontSize': '12px',
-                         'lineHeight': '15px',
+    'fontFamily': 'monospace',
+     'fontSize': '12px',
+     'lineHeight': '15px',
         'backgroundImage': 
'url('+$.dm.ctrl.options.dm_core_asset_root+'images/codeArea/lines.png)',
         'backgroundRepeat': 'no-repeat',
         'backgroundPosition': '0 0',
-                         'paddingLeft': '28px'
-                 }).unbind().addClass("dm_code_area").focus();
+     'paddingLeft': '28px'
+    }).unbind().addClass("dm_code_area").focus();
       
       if (this.options.lines) 
       {

Modified: plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreConfig.js
===================================================================
--- plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreConfig.js        
2010-02-12 20:47:27 UTC (rev 27980)
+++ plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreConfig.js        
2010-02-12 20:51:30 UTC (rev 27981)
@@ -4,8 +4,8 @@
   defaults : {
     ajaxData: {
       dm_cpi:  dm_configuration.page_id || 0,
-                       // tell the server the xhr nature of the request. 
Usefull when uploading file
-                       dm_xhr:  1
+   // tell the server the xhr nature of the request. Usefull when uploading 
file
+   dm_xhr:  1
     }
   },
   base : {}
@@ -29,13 +29,13 @@
 // jQuery plugins
 if ($.blockUI)
 {
-       $.blockUI.defaults = $.extend($.blockUI.defaults, {
+ $.blockUI.defaults = $.extend($.blockUI.defaults, {
     css:        {},
     overlayCSS: {},
     message:    ' ',
-               fadeIn:     0,
-               fadeOut:    0
-       });
+  fadeIn:     0,
+  fadeOut:    0
+ });
 }
 
 })(jQuery);
\ No newline at end of file

Modified: plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreCtrl.js
===================================================================
--- plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreCtrl.js  2010-02-12 
20:47:27 UTC (rev 27980)
+++ plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreCtrl.js  2010-02-12 
20:51:30 UTC (rev 27981)
@@ -9,11 +9,11 @@
     }
 
   };
-       
-       $(function()
-       {
-         $.dm.ctrl.options = $.extend($.dm.defaults, dm_configuration);
-         $.dm.ctrl.init();
-       });
+ 
+ $(function()
+ {
+   $.dm.ctrl.options = $.extend($.dm.defaults, dm_configuration);
+   $.dm.ctrl.init();
+ });
   
 })(jQuery);
\ No newline at end of file

Modified: plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreEditCtrl.js
===================================================================
--- plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreEditCtrl.js      
2010-02-12 20:47:27 UTC (rev 27980)
+++ plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreEditCtrl.js      
2010-02-12 20:51:30 UTC (rev 27981)
@@ -38,10 +38,10 @@
           $(e.target).show().parent().css('opacity', 1);
         },
         resizable: false
-                 }, options || {});
+    }, options || {});
       
       opt.dialogClass = opt['class'] ? opt['class'] + " dm" : "dm";
-                       
+   
       var $dialog = $('<div>').dialog(opt).bind('dialogclose', function()
       {
         setTimeout(function() {
@@ -82,24 +82,24 @@
       
       return $dialog;
     },
-               
-               errorDialog: function(title, body, opt)
-               {
-                       opt = $.extend({
+  
+  errorDialog: function(title, body, opt)
+  {
+   opt = $.extend({
         title:    title,
         position: [5, 5],
         buttons: {
           Close: function() { $(this).dialog('close'); }
         }
       }, opt || {});
-                       
-                       if ($existing = $('#dm_error_dialog div.dm_error'))
-                       {
-                               $existing.dialog('close');
-                       }
+   
+   if ($existing = $('#dm_error_dialog div.dm_error'))
+   {
+    $existing.dialog('close');
+   }
           
       $('<div class="dm_error">').html(body).dialog(opt).parent().attr('id', 
'dm_error_dialog').addClass('dm');
-               }
+  }
   });
-       
+ 
 })(jQuery);
\ No newline at end of file

Modified: plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreEditPlugins.js
===================================================================
--- plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreEditPlugins.js   
2010-02-12 20:47:27 UTC (rev 27980)
+++ plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreEditPlugins.js   
2010-02-12 20:51:30 UTC (rev 27981)
@@ -194,56 +194,56 @@
     }
     
   });
-       
-       /*
-        * Make ui dialogs position: fixed
-        */
-       $(function()
+ 
+ /*
+  * Make ui dialogs position: fixed
+  */
+ $(function()
   {
-               if ($.ui.dialog) 
-               {
-                       $.ui.dialog.prototype._position = function(pos)
-                       {
-                               var wnd = $(window), pTop = 0, pLeft = 0, 
minTop = pTop;
-                               
-                               if ($.inArray(pos, ['center', 'top', 'right', 
'bottom', 'left']) >= 0) 
-                               {
-                                       pos = [pos == 'right' || pos == 'left' 
? pos : 'center', pos == 'top' || pos == 'bottom' ? pos : 'middle'];
-                               }
-                               
-                               if (pos.constructor != Array && pos.constructor 
!= Object) 
-                               {
-                                       pos = ['center', 'middle'];
-                               }
-                               
-                               if (pos[0].constructor == Number) 
-                               {
-                                       pLeft += pos[0];
-                               }
-                               else 
-                               {
-                                       pLeft += (wnd.width() - 
this.uiDialog.outerWidth()) / 2;
-                               }
-                               
-                               if (pos[1].constructor == Number) 
-                               {
-                                       pTop += pos[1];
-                               }
-                               else 
-                               {
-                                       var dialogHeight = 350;
-                                       pTop += (wnd.height() - dialogHeight) / 
2;
-                               }
-                               
-                               // prevent the dialog from being too high (make 
sure the titlebar is accessible)
-                               pTop = Math.max(pTop, minTop);
-                               this.uiDialog.css({
-                                       position: 'fixed',
-                                       top: pTop,
-                                       left: pLeft
-                               });
-                       };
-               }
+  if ($.ui.dialog) 
+  {
+   $.ui.dialog.prototype._position = function(pos)
+   {
+    var wnd = $(window), pTop = 0, pLeft = 0, minTop = pTop;
+    
+    if ($.inArray(pos, ['center', 'top', 'right', 'bottom', 'left']) >= 0) 
+    {
+     pos = [pos == 'right' || pos == 'left' ? pos : 'center', pos == 'top' || 
pos == 'bottom' ? pos : 'middle'];
+    }
+    
+    if (pos.constructor != Array && pos.constructor != Object) 
+    {
+     pos = ['center', 'middle'];
+    }
+    
+    if (pos[0].constructor == Number) 
+    {
+     pLeft += pos[0];
+    }
+    else 
+    {
+     pLeft += (wnd.width() - this.uiDialog.outerWidth()) / 2;
+    }
+    
+    if (pos[1].constructor == Number) 
+    {
+     pTop += pos[1];
+    }
+    else 
+    {
+     var dialogHeight = 350;
+     pTop += (wnd.height() - dialogHeight) / 2;
+    }
+    
+    // prevent the dialog from being too high (make sure the titlebar is 
accessible)
+    pTop = Math.max(pTop, minTop);
+    this.uiDialog.css({
+     position: 'fixed',
+     top: pTop,
+     left: pLeft
+    });
+   };
+  }
   });
 
 })(jQuery);
\ No newline at end of file

Modified: plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreMarkdown.js
===================================================================
--- plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreMarkdown.js      
2010-02-12 20:47:27 UTC (rev 27980)
+++ plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreMarkdown.js      
2010-02-12 20:51:30 UTC (rev 27981)
@@ -5,75 +5,75 @@
   {
     _init: function()
     {
-                       this.markitup();
-                       
-                       this.selection = null;
-                       
-                       this.drop();
-                       
-                       this.saveSelection();
+   this.markitup();
+   
+   this.selection = null;
+   
+   this.drop();
+   
+   this.saveSelection();
     },
-               
-               saveSelection: function()
-               {
-                       var self = this;
-                       
-                       $('#dm_page_bar_toggler, 
#dm_media_bar_toggler').bind('click', function()
-                       {
-                   self.selection = self.element.getSelection();
-                       });
-               },
-               
-               getSelection: function()
-               {
-                       return (this.selection && this.selection.length) ? 
this.selection : this.element.getSelection();
-               },
-               
-               markitup: function()
-               {
+  
+  saveSelection: function()
+  {
+   var self = this;
+   
+   $('#dm_page_bar_toggler, #dm_media_bar_toggler').bind('click', function()
+   {
+      self.selection = self.element.getSelection();
+   });
+  },
+  
+  getSelection: function()
+  {
+   return (this.selection && this.selection.length) ? this.selection : 
this.element.getSelection();
+  },
+  
+  markitup: function()
+  {
       this.element.markItUp(dmMarkitupMarkdown);
-               },
-               
-               drop: function()
-               {
-      var self = this;
-                       
-                       self.element.droppable({
-        accept:       '#dm_page_bar li, #dm_media_bar li.file.image',
-        activeClass:  'droppable_active',
-        hoverClass:   'droppable_hover',
-        //          tolerance:    'touch',
-        drop: function(e, ui)
+  },
+  
+  drop: function()
+  {
+    var self = this;
+   
+    self.element.droppable({
+      accept:       '#dm_page_bar li, #dm_media_bar li.file.image',
+      activeClass:  'droppable_active',
+      hoverClass:   'droppable_hover',
+      //          tolerance:    'touch',
+      drop: function(e, ui)
+      {
+        var selection = self.getSelection(),
+        linkText = selection.text || $.trim(ui.draggable.find('>a').text()),
+        scrollTop = self.element.scrollTop();
+     
+        if (ui.draggable.hasClass('file'))
         {
-          var selection = self.getSelection(),
-          linkText = selection.text || ui.draggable.find('>a').text(),
-          scrollTop = self.element.scrollTop();
-                                       
-                                       if (ui.draggable.hasClass('file'))
-                                       {
-                                               var type = "media";
-                                               var placeholder = 
"!["+linkText+"]("+type+":"+ui.draggable.attr('id').replace(/dmm/, '')+")"
-                                       }
-                                       else
-                                       {
-            var type = "page";
-            var placeholder = 
"["+linkText+"]("+type+":"+ui.draggable.attr('id').replace(/dmp/, '')+")"
-                                       }
+          var type = "media";
+          var placeholder = 
"!["+linkText+"]("+type+":"+ui.draggable.attr('id').replace(/dmm/, '')+")"
+        }
+        else
+        {
+          var type = "page";
+          var placeholder = 
"["+linkText+"]("+type+":"+ui.draggable.attr('id').replace(/dmp/, '')+")"
+        }
           
-          if (selection) 
-          {
-                                               var val = self.element.val();
-                                               self.element.val(val.substr(0, 
selection.start) + placeholder + val.substr(selection.end, val.length));
-          }
-          else
-          {
-            self.element.val($elem.val()+placeholder);
-          }
+        if (selection)
+        {
+          var val = self.element.val();
+          self.element.val(val.substr(0, selection.start) + placeholder + 
val.substr(selection.end, val.length));
+        }
+        else
+        {
+          self.element.val($elem.val()+placeholder);
+        }
           
-          self.element.scrollTop(scrollTop);
-        }
-      });
-               }
-  });
+        self.element.scrollTop(scrollTop);
+      }
+    });
+  }
+});
   
 })(jQuery);
\ No newline at end of file

Modified: plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCorePageBar.js
===================================================================
--- plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCorePageBar.js       
2010-02-12 20:47:27 UTC (rev 27980)
+++ plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCorePageBar.js       
2010-02-12 20:51:30 UTC (rev 27981)
@@ -50,12 +50,12 @@
         }
       });
     },
-               
-               loaded: function()
-               {
-                       
-               },
     
+    loaded: function()
+    {
+
+    },
+    
     open: function()
     {
       var pageBar = this;
@@ -77,26 +77,26 @@
     
     refresh: function()
     {
-      var pageBar = this;
+      var self = this;
       
       $tree = $('#dm_page_tree');
-                       
-                       $tree.tree(pageBar.getTreeOptions());
+
+      $tree.jstree(self.getTreeOptions($tree));
       
       if ($.fn.draggable) 
       {
-        $('li', $tree).draggable({
+        $tree.find('li').draggable({
           containment: 'document',
           distance: 20,
           revert: 'invalid',
-                                       zIndex: 1000,
+          zIndex: 1000,
           helper: function(e)
           {
             return $('<div 
class="dm_page_draggable_helper">').html($(this).find('a:first').clone()).appendTo($('body'));
           },
           start: function(event, ui)
           {
-            pageBar.close();
+            self.close();
             $('div.markItUp, input.dm_link_droppable').addClass('active');
           },
           stop: function(event, ui)

Modified: plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCorePlugins.js
===================================================================
--- plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCorePlugins.js       
2010-02-12 20:47:27 UTC (rev 27980)
+++ plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCorePlugins.js       
2010-02-12 20:51:30 UTC (rev 27981)
@@ -14,8 +14,8 @@
     {
     }
   };
-       
-       $.loadStylesheets = function(stylesheets)
+ 
+ $.loadStylesheets = function(stylesheets)
   {
     $.each(stylesheets, function()
     {

Modified: plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreTabForm.js
===================================================================
--- plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreTabForm.js       
2010-02-12 20:47:27 UTC (rev 27980)
+++ plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreTabForm.js       
2010-02-12 20:51:30 UTC (rev 27981)
@@ -22,7 +22,7 @@
     markErrorTabs: function()
     {
       var self = this;
-                       
+   
       self.element.find('>ul.ui-tabs-nav a').each(function()
       {
         if (self.element.find('div.ui-tabs-panel' + $(this).attr('href') + ' 
ul.error_list').length) 

Modified: plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreToolBar.js
===================================================================
--- plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreToolBar.js       
2010-02-12 20:47:27 UTC (rev 27980)
+++ plugins/diemPlugin/trunk/dmCorePlugin/web/js/dmCoreToolBar.js       
2010-02-12 20:51:30 UTC (rev 27981)
@@ -4,69 +4,69 @@
   
   initToolBar: function()
   {
-               this.initSelectCulture();
+  this.initSelectCulture();
 
     $('#dm_select_theme').bind('change', function() {
       location.href = 
$.dm.ctrl.getHref('+/dmFront/selectTheme')+'?theme='+$(this).val()
     });
 
-               if ($link = $('a.dm_refresh_link', this.element).orNot())
-               {
-                       this.initRefresh($link);
-               }
+  if ($link = $('a.dm_refresh_link', this.element).orNot())
+  {
+   this.initRefresh($link);
+  }
   },
-       
-       initSelectCulture: function()
-       {
+ 
+ initSelectCulture: function()
+ {
     $('#dm_select_culture').bind('change', function() {
       location.href = 
$.dm.ctrl.getHref('+/dmCore/selectCulture')+'?culture='+$(this).val()
     });
   },
-       
-       initRefresh: function($link)
-       {
-               var self = this;
-               
-               $link.click(function() {
-                       $.blockUI();
+ 
+ initRefresh: function($link)
+ {
+  var self = this;
+  
+  $link.click(function() {
+   $.blockUI();
       $.ajax({
         url:      $link.attr('href'),
         success:  function(html)
         {
           $.blockUI({
             message: html
-                                       });
-                                       self.refreshStep($('div.blockMsg 
div.dm_refresh_show').metadata(), 0);
+     });
+     self.refreshStep($('div.blockMsg div.dm_refresh_show').metadata(), 0);
         }
       });
-                       return false;
+   return false;
     });
-       },
-       
-       refreshStep: function(data, step)
-       {
-               var self = this;
-               
-               $('div.blockMsg div.dm_refresh_show ul.dm_steps 
li.current').removeClass('current');
-               
-               $('div.blockMsg div.dm_refresh_show 
ul.dm_steps').append($('<li>').addClass('current').text(data.msg));
-               
-               if ('ajax' == data.type)
-               {
-                       $.ajax({
+ },
+ 
+ refreshStep: function(data, step)
+ {
+  var self = this;
+  
+  $('div.blockMsg div.dm_refresh_show ul.dm_steps 
li.current').removeClass('current');
+  
+  $('div.blockMsg div.dm_refresh_show 
ul.dm_steps').append($('<li>').addClass('current').text(data.msg));
+  
+  if ('ajax' == data.type)
+  {
+   $.ajax({
         url:      data.url,
-                               dataType: 'json',
+    dataType: 'json',
         success:  function(data)
         {
           self.refreshStep(data, step+1);
         }
       });
-               }
-               else
-               {
-                       location.href = data.url;
-               }
-       }
+  }
+  else
+  {
+   location.href = data.url;
+  }
+ }
 
 };
 

-- 
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