Small fixes
authorMarcel Werk <burntime@woltlab.com>
Wed, 13 Jun 2012 22:24:27 +0000 (00:24 +0200)
committerMarcel Werk <burntime@woltlab.com>
Wed, 13 Jun 2012 22:24:27 +0000 (00:24 +0200)
wcfsetup/install/files/acp/templates/cronjobList.tpl
wcfsetup/install/files/acp/templates/optionFieldList.tpl
wcfsetup/install/files/lib/system/option/user/UserOptionHandler.class.php
wcfsetup/install/files/lib/system/template/plugin/EncodeJSModifierTemplatePlugin.class.php
wcfsetup/install/files/lib/util/StringUtil.class.php
wcfsetup/install/files/style/alerts.less
wcfsetup/install/files/style/forms.less
wcfsetup/install/files/style/inputs.less
wcfsetup/install/files/style/layout.less

index a3e941fc50d2a1d68f1c38c4c09e9b2e9c6a2f16..d38b26d713603970a7fc12d675e82f37b46290d7 100644 (file)
@@ -5,34 +5,34 @@
                <h1>{lang}wcf.acp.cronjob.list{/lang}</h1>
                <h2>{lang}wcf.acp.cronjob.subtitle{/lang}</h2>
        </hgroup>
-       
-       <script type="text/javascript">
-               //<![CDATA[
-               $(function() {
-                       new WCF.Action.Delete('wcf\\data\\cronjob\\CronjobAction', $('.jsCronjobRow'));
-                       new WCF.Action.Toggle('wcf\\data\\cronjob\\CronjobAction', $('.jsCronjobRow'));
-                       new WCF.Action.SimpleProxy({
-                               action: 'execute',
-                               className: 'wcf\\data\\cronjob\\CronjobAction',
-                               elements: $('.jsCronjobRow .jsExecuteButton')
-                       }, {
-                               success: function(data, statusText, jqXHR) {
-                                       $('.jsCronjobRow').each(function(index, row) {
-                                               $button = $(row).find('.jsExecuteButton');
-                                               
-                                               if (WCF.inArray($($button).data('objectID'), data.objectIDs)) {
-                                                       // insert feedback here
-                                                       $(row).find('td.columnNextExec').html(data.returnValues[$($button).data('objectID')].formatted);
-                                                       $(row).wcfHighlight();
-                                               }
-                                       });
-                               }
-                       });
-               });
-               //]]>
-       </script>
 </header>
 
+<script type="text/javascript">
+       //<![CDATA[
+       $(function() {
+               new WCF.Action.Delete('wcf\\data\\cronjob\\CronjobAction', $('.jsCronjobRow'));
+               new WCF.Action.Toggle('wcf\\data\\cronjob\\CronjobAction', $('.jsCronjobRow'));
+               new WCF.Action.SimpleProxy({
+                       action: 'execute',
+                       className: 'wcf\\data\\cronjob\\CronjobAction',
+                       elements: $('.jsCronjobRow .jsExecuteButton')
+               }, {
+                       success: function(data, statusText, jqXHR) {
+                               $('.jsCronjobRow').each(function(index, row) {
+                                       $button = $(row).find('.jsExecuteButton');
+                                       
+                                       if (WCF.inArray($($button).data('objectID'), data.objectIDs)) {
+                                               // insert feedback here
+                                               $(row).find('td.columnNextExec').html(data.returnValues[$($button).data('objectID')].formatted);
+                                               $(row).wcfHighlight();
+                                       }
+                               });
+                       }
+               });
+       });
+       //]]>
+</script>
+
 <div class="contentNavigation">
        {pages print=true assign=pagesLinks controller="CronjobList" link="pageNo=%d&sortField=$sortField&sortOrder=$sortOrder"}
        
                                {/content}
                        </tbody>
                </table>
-               
        </div>
 {hascontentelse}
-       <p class="warning">{lang}wcf.acp.cronjob.noneAvailable{/lang}</p>
+       <p class="info">{lang}wcf.acp.cronjob.noneAvailable{/lang}</p>
 {/hascontent}
 
 <div class="contentNavigation">
index d16ee009e6f32fc6aaa836078cbadf2eebe39109..70d15c752019b527ca87c6d6c55ecd4080a29c2f 100644 (file)
@@ -5,7 +5,7 @@
        {else}
                {assign var=error value=''}
        {/if}
-       <dl class="{$option->optionName}Input">
+       <dl class="{$option->optionName}Input{if $error} formError{/if}">
                <dt{if $optionData[cssClassName]} class="{$optionData[cssClassName]}"{/if}><label for="{$option->optionName}">{lang}{@$langPrefix}{$option->optionName}{/lang}</label></dt>
                <dd>{@$optionData[html]}
                        {if $error}
@@ -13,7 +13,7 @@
                                        {if $error == 'empty'}
                                                {lang}wcf.global.form.error.empty{/lang}
                                        {else}  
-                                               {lang}wcf.user.option.error.{$error}{/lang}
+                                               {lang}{@$langPrefix}error.{$error}{/lang}
                                        {/if}
                                </small>
                        {/if}
index a6fda43f964d4fb46afe2a7cec2fcb39d4d7121f..26978f1bdafc0adab4c56df0d89516d4dc2d96e5 100644 (file)
@@ -129,7 +129,7 @@ class UserOptionHandler extends OptionHandler {
                        $option->setUser($this->user);
                }
                
-               if ($this->inRegistration && !$option->askDuringRegistration) {
+               if ($this->inRegistration && !$option->askDuringRegistration && !$option->required) {
                        return false;
                }
                
index 8a5b66e76308ffb98c5326c02900fe2552ffbe39..3494d32718f7e4ee0368b54783bbfefdc3717774 100644 (file)
@@ -23,18 +23,6 @@ class EncodeJSModifierTemplatePlugin implements IModifierTemplatePlugin {
         * @see wcf\system\template\IModifierTemplatePlugin::execute()
         */
        public function execute($tagArgs, TemplateEngine $tplObj) {
-               // escape backslash
-               $tagArgs[0] = StringUtil::replace("\\", "\\\\", $tagArgs[0]);
-               
-               // escape singe quote
-               $tagArgs[0] = StringUtil::replace("'", "\'", $tagArgs[0]);
-               
-               // escape new lines
-               $tagArgs[0] = StringUtil::replace("\n", '\n', $tagArgs[0]);
-               
-               // escape slashes
-               $tagArgs[0] = StringUtil::replace("/", '\/', $tagArgs[0]);
-               
-               return $tagArgs[0];
+               return StringUtil::encodeJS($tagArgs[0]);
        }
 }
index eacf669f433b1abe1202be4e9c01402564bb5c88..0278114ce149f745e3b592aeeea61621e6d1d929 100644 (file)
@@ -139,6 +139,30 @@ final class StringUtil {
                return @htmlspecialchars($string, ENT_COMPAT, 'UTF-8');
        }
        
+       /**
+        * Converts javascript special characters.
+        *
+        * @param       string          $string
+        * @return      string          $string
+        */
+       public static function encodeJS($string) {
+               if (is_object($string)) $string = $string->__toString();
+               
+               // escape backslash
+               $string = StringUtil::replace("\\", "\\\\", $string);
+               
+               // escape singe quote
+               $string = StringUtil::replace("'", "\'", $string);
+               
+               // escape new lines
+               $string = StringUtil::replace("\n", '\n', $string);
+               
+               // escape slashes
+               $string = StringUtil::replace("/", '\/', $string);
+               
+               return $string;
+       }
+       
        /**
         * Decodes html entities.
         *
index 8df228fc30d14fe77720a9986ab62b94d6d9f8fb..dcab7773f0f0d302af12dde04e77630fe19c1753 100644 (file)
@@ -22,7 +22,7 @@
                height: 24px;
                left: 13px;
                position: absolute;
-               top: 6px;
+               top: 5px;
                width: 24px;
        }
        
index bea861217109e064b8193944235f30432cd868fd..04f1fb8425530fa170539c5face0b6342aa268ac 100644 (file)
@@ -110,8 +110,10 @@ fieldset {
                }
                
                /* disabled state */
-               &.disabled > dt {
-                       color: @wcfDimmedColor;
+               &.disabled {
+                       > dt, > dd > label {
+                               color: @wcfDimmedColor;
+                       }
                }
        }
 }
index e0e4e155f100c110fa6e1da1508613a73a9d1d38..4f7276c6a6569ebb5664a59651830bce2973dbd8 100644 (file)
@@ -86,7 +86,7 @@ textarea:focus,
 select[multiple]:focus {
        background-color: @wcfInputHoverBackgroundColor;
        border-color: @wcfInputHoverBorderColor;
-       outline: none;
+       outline: 0;
        
        .boxShadowNative(~"0 0 5px" fade(@wcfInputHoverBorderColor, 50%) ~", inset 0 1px 5px rgba(0, 0, 0, .1)");
 }
@@ -134,6 +134,18 @@ select[multiple][disabled] {
        .boxShadowNative(~"0 0 5px" fade(@wcfErrorBackgroundColor, 50%) ~", inset 0 1px 5px rgba(0, 0, 0, .1)");
 }
 
+/* success state */
+.formSuccess input[type='text'],
+.formSuccess input[type='search'],
+.formSuccess input[type='email'],
+.formSuccess input[type='url'],
+.formSuccess input[type='password'],
+.formSuccess textarea {
+       border-color: @wcfSuccessBackgroundColor;
+       
+       .boxShadowNative(~"0 0 5px" fade(@wcfSuccessBackgroundColor, 50%) ~", inset 0 1px 5px rgba(0, 0, 0, .1)");
+}
+
 /* width */
 textarea {
        width: 99%;
index e10f6bb740bc0a89ce4619259216dbabbb9cc730..3a4996d53ec4f4f976af53f8fce224180172945c 100644 (file)
@@ -26,7 +26,7 @@ a {
 }
 
 :focus {
-       outline: 0;
+       /*outline: 0;*/
 }
 
 #pageHeader {