webksde

Typesetter aka gpEasy – Remove edit and login locks

To remove the edit lock, simply navigate to your main directory, open the „data“ folder, and delete the temporary „lock_….“ file.

To reset the login lock, navigate to: „/data/_site/“ and edit the „user.php“. Now simply reset the „attempts“ to 0.

    Adaptive background (color taken from an image via JS)

    Take a look at this amazing library. You may now the effect from Googles image search.

    The library take´s the „primary color“ of an image, and set it to the image container as background color. Similar to the tv technique „Ambient Light“.

      Webfont „Amiri“ wrong underline position

      In a current project we used the beautiful looking font „Amiri“. After hovering the first link, i saw the underline appearing way too to far at the bottom.

      As we can´t fix this via CSS, i modified the font with FontForge. The result is called „Amirifix“ and is attached to this post.

      Amiri is an Open Font by Khaled Hosny & Sebastian Kosch.

      Credits:

      Copyright (c) 2010-2013, Khaled Hosny <khaledhosny@eglug.org>.
      Portions copyright (c) 2010, Sebastian Kosch <sebastian@aldusleaf.org>

      This Font Software is licensed under the Open Font License, Version 1.1.

        iOS Radiobuttons & Checkox Label behavoir

        For some reason, a click on the label of radio- & checkbox form elements does not work (to check the related form item). After some research we figured out, that we have to set the css attribute cursor:pointer to fix this issue.

        Another amazing „feature“ made by Apple, big thx for wasting my time guy´s, you´re so great.

          Drupal Mimemail Module (HTML Mails, Newsletter, …) unwanted attachment.dat *Update*

          In a current project we ran into a curious problem, every HTML Mail has an file attachment named „attachment.dat“.

          After some research in the „mimemail.theme.inc“ (function „template_preprocess_mimemail_message()“), we figured out that the problem is located inside the $css content.

          In our case the implementation of the google webfont produces this issue (@import url(http://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600)). Basicly @import has to work inside html mails, so mimemail seems to do something wrong here?

          Whatever. We can work around this problem, using the <link …> – implemantation inside the mimemail-message.tpl file instead of the declaration directly inside the css code.

           

            How to detect multiline text with jQuery

            Currently there is no way to do this job just with css. I saw various Javascript solutions to do this, most of them are way to complicated (for my use case).

            In my case i just need it to detect multiline field labels. So … as i have a fix font size here, i just look out for the elements height via jquery and add a multiline class if its higher then on line of text.

            Idea to modify this: Get the height of a one-liner label dynamically (compare the determined height values and use the flattest, also check for empty labels …).

                    /* Check if field labels are heigher then one line */
                    $(".entityform label").each(function( index ) {
                      label = $(this);
                      labelHeight = label.height();
                      if(labelHeight > 20){
                        label.addClass('multiline-label');
                      }
                    });
            

              Fixed positioned element is aligned relative to the parent

              If you have an fixed element which is curiously positioned relative to it´s parent (what is definitely against the specification „An element with a fixed position is positioned relative to the browser window, and will not move even if the window is scrolled – http://www.w3schools.com/css/css_positioning.asp“), you probably have something done with the transform-property on any of the parent elements.

              This will cause this totally absurd behavoir (in every major browser, so maybe the transform specification sucks, or the w3c has some.. reason to do this kind of sh** … whatever).

              Here is an example of the „bug“: http://codepen.io/anon/pen/gpPVZV

              Thanks a lot to Mr. Blairhippo you saved my day.

                Shopware (4) Kategoriebild in der Kategoriebeschreibung ausgeben

                Warum auch immer das nicht von Shopware aus schon implementiert ist, hier eine Variante welche die Bilder (hochzuladen im Backend > Kategorien > KategorieX) in der Kategoriebeschreibung ausgibt.

                Die betroffene Templatedatei beinfdet sich im ordner frontend/listing/text.tpl. Zusätzlich sollte im Media Manager ein eigener Ordner „Kategoriebilder“ o.Ä. angelegt werden. In den Einstellungen des Ordners (rechtsklick auf den Ordner), muss nun noch die Thumbnail Generierung eingerichtet werden.

                Diese Lösung ist alles andere als perfekt, aber vllt. rettet es ja dem ein oder anderen den Tag 🙂
                Anzupassen ist die Thumbnail Size, der Pfad sollte identisch sein.

                              {assign var="category_thumbnail_size" value="120x120"}
                              {assign var="category_thumbnail" value="media/image/thumbnail/{$sCategoryContent.media.name}_{$category_thumbnail_size}.{$sCategoryContent.media.extension}"}
                              
                              {if !file_exists($category_thumbnail)}
                                {* FALLBACK *}
                                {assign var="category_thumbnail" value="{$sCategoryContent.media.path}"}
                              {/if}
                              {if $category_thumbnail}
                                {$sCategoryContent.cmsheadline}
                              {/if}
                

                  CSS Keyframe Animation fade out and hide without display:none

                  The Display property is not working well with CSS animations, if you read this, you already know. So we have to find a way around.

                  In my case, i have a layer above the entire page which is overlaying the page content. As you already tried out, visibility won´t work also, as it´s the same as opacity:0;

                  Solutions:

                  1. You can move the entire layer out of the viewport eg. position:absolute; left:-9000px;
                  2. You can try out using a negative z-index to get the layer behind the page-content (makes only sense for layers which are absolute / fixed positioned over the page, not in normal element flow).
                  3. Make overflow:hidden; and height:0; – take a look:
                  @keyframes fadeOutAndHide {
                      0% {
                        opacity:1.0;
                      }
                      99%{
                        opacity:0;
                        height:100%;
                      }
                      100% {
                        height:0;
                      }
                  }
                  .page-welcome-layer.hidden{
                    animation:fadeOutAndHide ease-in 1.5s;
                    animation-fill-mode:forwards;
                    animation-iteration-count: 1;
                    overflow:hidden;
                  }
                  

                    Stop OWL Carousel 1.x if theres only one slide

                            // Stop OWL Carousel if theres only one slide
                            $owlContainers = jQuery(".owl-carousel");
                            $owlContainers.each(function () {
                              $owlContainer = $(this);
                              $owlSlides = $owlContainer.find('div.owl-item');
                              alert($owlSlides.length);
                              // More than one slide - initialize the carousel
                              if ($owlSlides.length <= 1) {
                                $owlContainer.data('owlCarousel').stop();
                              }
                            });