ÿþ/ * *  
   *   S a t u r a   p r o j e c t  
   *   T h i s   f i l e   i s   p a r t   o f   t h e   S a t u r a   C M S .  
   *  
   *   @ a u t h o r   J a n   `a b a t  
   * /  
  
 w i n d o w . a d d E v e n t ( ' d o m r e a d y ' ,   f u n c t i o n ( e )   {  
     d e l e t e C o n f i r m ( ) ;  
     r o w H i g h l i g h t ( ) ;  
     r o w O n e C l i c k ( ) ;  
     f o r m E l e m e n t H i g h l i g h t ( ) ;  
     o p e n B l a n k ( ) ;  
  
     i f   ( $ ( ' c o n t e n t - t y p e ' ) ) {  
         s e t C o n t e n t P a g e E d i t ( ) ;  
         $ ( ' c o n t e n t - t y p e ' ) . a d d E v e n t ( ' c h a n g e ' ,   f u n c t i o n ( ) {  
             s e t C o n t e n t P a g e E d i t ( ) ;  
         } ) ;  
     }  
      
     m i l k b o x   =   n e w   M i l k b o x ( {   a u t o S i z e : f a l s e   } ) ;  
 } ) ;  
  
  
 f u n c t i o n   o p e n B l a n k ( ) {  
     $ $ ( ' a [ r e l ] ' ) . e a c h (   f u n c t i o n ( i t e m ,   i n d e x   )   {  
         / /   n a h r a z e n i   r e l = " b l a n k "   n a   t a r g e t = " _ b l a n k "  
         i f ( i t e m . g e t ( ' r e l ' )   = =   ' b l a n k ' ) {  
             i t e m . s e t ( ' t a r g e t ' ,   ' _ b l a n k ' )   ;  
         }  
         / /   p r i d a   k   r e l = " c o n f i r m "   j s   p o p u p   z d a l i   p o k r a c o v a t   n a   a d r e s u  
         i f ( i t e m . g e t ( ' r e l ' )   = =   ' c o n f i r m ' ) {  
             i t e m . a d d E v e n t ( ' c l i c k ' ,   f u n c t i o n ( e ) {  
                 i f   ( ! c o n f i r m ( i t e m . g e t ( ' t i t l e ' )   +   '   \ ? ' ) ) {  
                     e . s t o p ( ) ;  
                 }  
             } ) ;  
         }  
     } ) ;  
 }  
  
  
 f u n c t i o n   i e 6 c o n f i r m ( ) {  
     i f   ( c o n f i r m ( S a t u r a . m s g s . i e 6 c o n f i r m ) ) {  
         w i n d o w . o p e n ( ' h t t p : / / w w w . m i c r o s o f t . c o m / c z e / w i n d o w s / i n t e r n e t - e x p l o r e r / d e f a u l t . a s p x ' ) ;  
     }  
 }  
  
  
 f u n c t i o n   d e l e t e C o n f i r m ( ) {  
     $ $ ( ' . b t n - d e l e t e ' ) . a d d E v e n t ( ' c l i c k ' , f u n c t i o n ( e ) {  
         v a r   m s g   =   t h i s . t i t l e   ?   t h i s . t i t l e   :   " d e l e t e   ? " ;  
         i f ( ! c o n f i r m ( m s g ) )   e . s t o p ( ) ;  
     } ) ;  
 }  
  
  
 f u n c t i o n   r o w O n e C l i c k ( ) {  
     v a r   r o w s   =   $ $ ( ' . s a t u r a - t a b l e   t a b l e . h o v e r e d   t r ' ) ;  
     r o w s . e a c h ( f u n c t i o n ( i t e m ,   i n d e x ) {  
         v a r   a n c h o r s   =   i t e m . g e t E l e m e n t s ( ' a . b t n - s h o w ' ) ;  
  
         a n c h o r s . e a c h ( f u n c t i o n ( a n c h o r ) {  
             i f   ( a n c h o r . h r e f   ! =   " " ) {  
                 i t e m . s e t S t y l e ( ' c u r s o r ' , ' p o i n t e r ' ) ;  
                 i t e m . a d d E v e n t ( ' c l i c k ' ,   f u n c t i o n ( ) {  
                     w i n d o w . l o c a t i o n . h r e f   =   a n c h o r . h r e f ;  
                 } ) ;  
             }  
         } ) ;  
     } ) ;  
 }  
  
  
 f u n c t i o n   r o w H i g h l i g h t ( ) {  
     v a r   r o w s   =   $ $ ( ' . s a t u r a - t a b l e   t a b l e . h o v e r e d   t r ' ) ;  
     r o w s . e a c h ( f u n c t i o n ( i t e m ,   i n d e x ) {  
         i t e m . a d d E v e n t s ( {  
             ' m o u s e o v e r ' :   f u n c t i o n ( ) {  
                 i t e m . t o g g l e C l a s s ( ' h o v e r ' ) ;  
             } ,  
             ' m o u s e o u t ' :   f u n c t i o n ( ) {  
                 i t e m . t o g g l e C l a s s ( ' h o v e r ' ) ;  
             }  
         } ) ;  
     } ) ;  
 }  
  
  
 f u n c t i o n   f o r m E l e m e n t H i g h l i g h t ( ) {  
     v a r   e l s   =   $ $ ( ' . s a t u r a - t a b l e   f o r m   i n p u t ,   . s a t u r a - t a b l e   f o r m   t e x t a r e a ,   . s a t u r a - t a b l e   f o r m   s e l e c t ' ) ;  
     e l s . e a c h ( f u n c t i o n ( i t e m ,   i n d e x ) {  
         i t e m . a d d E v e n t s ( {  
             ' f o c u s ' :   f u n c t i o n ( ) {  
                 i t e m . t o g g l e C l a s s ( ' f o c u s e d ' ) ;  
             } ,  
             ' b l u r ' :   f u n c t i o n ( ) {  
                 i t e m . t o g g l e C l a s s ( ' f o c u s e d ' ) ;  
             }  
         } ) ;  
     } ) ;  
 }  
  
  
 f u n c t i o n   s e t C o n t e n t P a g e E d i t ( ) {  
     v a r   c o n t e n t   =   $ $ ( " # p a g e - c o n t e n t   d i v " ) ;  
     c o n t e n t . e a c h ( f u n c t i o n ( i t e m ,   i n d e x ) {  
         i t e m . s e t S t y l e ( ' d i s p l a y ' , ' n o n e ' ) ;  
     } ) ;  
     v a r   t y p e   =   $ ( ' c o n t e n t - t y p e ' ) . v a l u e ;  
     v a r   a t y p e   =   $ ( ' p a g e - c o n t e n t - ' + t y p e ) . s e t S t y l e ( ' d i s p l a y ' , ' b l o c k ' ) ;  
 }  
  
  
 f u n c t i o n   a j a x f i l e m a n a g e r ( f i e l d _ n a m e ,   u r l ,   t y p e ,   w i n )   {  
     v a r   a j a x f i l e m a n a g e r u r l   =   S a t u r a . c o n f i g . t i n y M c e P a t h + " s c r i p t s / t i n y _ m c e / p l u g i n s / a j a x f i l e m a n a g e r / a j a x f i l e m a n a g e r . p h p " ;  
     t i n y M C E . a c t i v e E d i t o r . w i n d o w M a n a g e r . o p e n ( {  
         u r l :   S a t u r a . c o n f i g . t i n y M c e P a t h + " s c r i p t s / t i n y _ m c e / p l u g i n s / a j a x f i l e m a n a g e r / a j a x f i l e m a n a g e r . p h p " ,  
         w i d t h :   7 8 2 ,  
         h e i g h t :   4 4 0 ,  
         i n l i n e   :   " y e s " ,  
         c l o s e _ p r e v i o u s   :   " n o "  
     } , {  
         w i n d o w   :   w i n ,  
         i n p u t   :   f i e l d _ n a m e  
     } ) ;  
 }  
  
  
 t i n y M C E . i n i t ( {  
     l a n g u a g e   :   S a t u r a . c o n f i g . l a n g u a g e ,  
     m o d e   :   " s p e c i f i c _ t e x t a r e a s " ,  
     e d i t o r _ s e l e c t o r   :   " e d i t - l i t e " ,  
     t h e m e   :   " s i m p l e "  
 } ) ;  
  
  
 t i n y M C E . i n i t ( {  
     l a n g u a g e   :   S a t u r a . c o n f i g . l a n g u a g e ,  
     m o d e   :   " s p e c i f i c _ t e x t a r e a s " ,  
     e d i t o r _ s e l e c t o r   :   " e d i t - f u l l " ,  
     e n t i t y _ e n c o d i n g   :   " r a w " ,  
     t h e m e   :   " a d v a n c e d " ,  
     p l u g i n s   :   " s a f a r i , p a g e b r e a k , s t y l e , l a y e r , t a b l e , s a v e , a d v h r , a d v i m a g e , a d v l i n k , i e s p e l l , i n l i n e p o p u p s , i n s e r t d a t e t i m e , p r e v i e w , m e d i a , s e a r c h r e p l a c e , p r i n t , c o n t e x t m e n u , p a s t e , d i r e c t i o n a l i t y , f u l l s c r e e n , n o n e d i t a b l e , v i s u a l c h a r s , n o n b r e a k i n g , x h t m l x t r a s , t e m p l a t e " ,  
     / /   T h e m e   o p t i o n s  
     t h e m e _ a d v a n c e d _ b u t t o n s 1   :   " s a v e , | , b o l d , i t a l i c , u n d e r l i n e , s t r i k e t h r o u g h , | , j u s t i f y l e f t , j u s t i f y c e n t e r , j u s t i f y r i g h t , j u s t i f y f u l l , f o r m a t s e l e c t , f o n t s i z e s e l e c t , h r , r e m o v e f o r m a t , v i s u a l a i d , | , s u b , s u p , | , c h a r m a p , f u l l s c r e e n " ,  
     t h e m e _ a d v a n c e d _ b u t t o n s 2   :   " c u t , c o p y , p a s t e , p a s t e t e x t , p a s t e w o r d , | , s e a r c h , r e p l a c e , | , b u l l i s t , n u m l i s t , | , o u t d e n t , i n d e n t , b l o c k q u o t e , | , u n d o , r e d o , | , l i n k , u n l i n k , a n c h o r , i m a g e , c l e a n u p , h e l p , c o d e , | , i n s e r t d a t e , i n s e r t t i m e , p r e v i e w , | , f o r e c o l o r , b a c k c o l o r " ,  
     t h e m e _ a d v a n c e d _ b u t t o n s 3   :   " " ,  
  
     t h e m e _ a d v a n c e d _ t o o l b a r _ l o c a t i o n   :   " t o p " ,  
     t h e m e _ a d v a n c e d _ t o o l b a r _ a l i g n   :   " l e f t " ,  
     t h e m e _ a d v a n c e d _ s t a t u s b a r _ l o c a t i o n   :   " b o t t o m " ,  
     t h e m e _ a d v a n c e d _ r e s i z i n g   :   t r u e ,  
  
     / /   E x a m p l e   c o n t e n t   C S S   ( s h o u l d   b e   y o u r   s i t e   C S S )  
     c o n t e n t _ c s s   :   " t h e m e s / d e f a u l t / s t y l e . c s s " ,  
  
     e x t e n d e d _ v a l i d _ e l e m e n t s   :   " h r [ c l a s s | w i d t h | s i z e | n o s h a d e ] " ,  
     f i l e _ b r o w s e r _ c a l l b a c k   :   " a j a x f i l e m a n a g e r " ,  
     p a s t e _ u s e _ d i a l o g   :   f a l s e ,  
     t h e m e _ a d v a n c e d _ r e s i z i n g   :   t r u e ,  
     t h e m e _ a d v a n c e d _ r e s i z e _ h o r i z o n t a l   :   t r u e ,  
     a p p l y _ s o u r c e _ f o r m a t t i n g   :   t r u e ,  
     f o r c e _ b r _ n e w l i n e s   :   t r u e ,  
     f o r c e _ p _ n e w l i n e s   :   f a l s e ,      
     r e l a t i v e _ u r l s   :   t r u e ,  
     p l u g i n _ i n s e r t d a t e _ d a t e F o r m a t   :   " % d . % m . % Y "  
 } ) ;  
  
  
 f u n c t i o n   e d i t A r e a L o a d ( i d ) {  
     i f   ( $ ( i d ) ) {  
         e d i t A r e a L o a d e r . i n i t ( {  
             i d :   i d   / /   i d   o f   t h e   t e x t a r e a   t o   t r a n s f o r m  
             , s t a r t _ h i g h l i g h t :   t r u e     / /   i f   s t a r t   w i t h   h i g h l i g h t  
             , a l l o w _ r e s i z e :   " b o t h "  
             , a l l o w _ t o g g l e :   t r u e  
             , w o r d _ w r a p :   t r u e  
             , l a n g u a g e :   S a t u r a . c o n f i g . l a n g u a g e  
             , s y n t a x :   " p h p "  
         } ) ;  
     }  
 }  
  
 f u n c t i o n   i e 6 c o n f i r m ( ) {  
     i f   ( c o n f i r m ( S a t u r a . m s g s . i e 6 c o n f i r m ) ) {  
         w i n d o w . o p e n ( ' h t t p : / / w w w . m i c r o s o f t . c o m / c z e / w i n d o w s / i n t e r n e t - e x p l o r e r / d e f a u l t . a s p x ' ) ;  
     }  
 }  
 
