mardi 4 août 2015

Filtered list with parent items - selected by cursor arrows. AngularJs

In my form i have input with dropdown, in dropdown I show json data like:

{
    "title": "Parent #1",
    "child" : [
        {"title":  "Child ##1"},
        {"title":  "Child ##2"},
        {"title":  "Child ##3"},
        {"title":  "Child ##4"}
    ]
}

I bind it to such html:

<div class='dropDownContainer'>
    <div class='filteredItemContainer'>
        <ul>
            <h5>Parent title</h5>
            <ul>
                <li>Child items</li>
                <li>Child items</li>
            </ul>
        </ul
    </div>
</div>

User can select any item - parent or child. I need to add possibility select item by cursor. How i can implement such functionality? I know how to do with simple ul list, but i don't know how to do it with such structure.



via Chebli Mohamed

Optimise Load-Time and Mobile/Browser-Compatibility

I am not designer and I am not coder! But I had a vision. How I wanted my site - so I worked really hard and long to get like it is now! (it only works on desktop computers - I need to detect mobile phone and shut down some effects ... this is the next step).

I know I have used some very dirty html to build these site - as soon we have the money I will pay someone to code it correctly with ajax or something:

http://ift.tt/1JJQSaN

But my question to you if you maybe have a little bite time: Do you have tips for me how I could optimize this site?

  • My biggest Problem is the Background-Video ... is there some way to load all other elements first and then the video?

  • Second problem: its all 1 html-file and the site is about 2mb big - is there a way first to load images when they are really needed?

  • You see some other Problems? I had with 1 computer some problems with the font (it was to big - dont know why - but in all other computers, it worked)

....

Edit: i found someone with the same Font- / Text- Bug!

http://ift.tt/1P3Le3u

Someone has an Idea how to fix that? Is it maybe becouse i use Line-Height?



via Chebli Mohamed

How to get a hover effect for glyphicon icons?

I'm trying to make glyphicon icon appear every time I hover my mouse over it. And I'm using <span> tag for it. But this refuses to work. What have I done wrong?

application.scss

 /*
 *= require bootstrap3-editable/bootstrap-editable
 *= require bootstrap-datepicker3
 *= require_tree .
 */

  @import "bootstrap-sprockets";
  @import "bootstrap";

.hovering:before {
display: none;
}

.hovering:hover:before {
display: block;
}

In my view file it looks like this:

  <span class='hovering'>
    <%= link_to user_task_path(current_user, task.id), method: :delete,
    data: { confirm: 'Are you sure?' }, remote: true do %>
      <i class="glyphicon glyphicon-trash"></i>
    <% end %>
  </span>



via Chebli Mohamed

Is it possible to implement a Mega Drop Down Menu using pure CSS?

I would like to implement a Mega Drop Down Menu for my Navigation Menu using pure CSS i.e. NO Javascript/JQuery. When the user hovers on a navigation item, I'd like to display a mega drown menu which stays active if the user is within the bounds of the menu. If the user moves away or hovers over a different menu, it should then display the relevant menu.

Navigation menu with mega drop down

The below image depicts exactly what I'm looking for. GAMES AND TOYS is the first nav-item which on hover should display the mega drop down menu (the overlay with a #ff1300 border). The yellow boxes represent the different nested divs that I'd like to show within a container div.

**Note: I've already tried putting the nav-item and a drop-down within a single div and using

.nav-item:hover .dropdownpanel {
    display: block 
/*    This is set to display: none to be hidden and then shown on hover */
}

Is there a way to achieve what I'm looking for?



via Chebli Mohamed

detection whether is an e-shop written in Magento

I'm trying to create a script which would do a simple thing. The input is a list of URLs and output is a list of those eshops which are written in Magento.

I've read that there is no way to realize whether is the eshop in Magento or something else but I've also read that there is a lot of signs that could tell you that this web page is using Magento almost 100% sure.

So I've found this page: magento detector which can tell you whether is it a Magento or not so I'm trying to use their information.

They say for example this:

Magento has its user interface files in a directory called /skin/. For the frontend (not the admin ui) the files are located in /skin/frontend. So if this directory exists in the page source then it is very likely that the store runs on Magento.

For example for this eshop: starkk told the detector that it is a magento and the one of condition it meets is the condition I've mentioned above.

How could I check whether the directory exists? I took a look on: http://ift.tt/1SHgVVO using browser but the page raises error.

And additional question: Do you know another and better way how to detect Magento?



via Chebli Mohamed

How to run the CSS3 animation to the end if the selector is not matching anymore?

I've always thought that CSS3 Animations (differently from CSS3 Transitions) once started, always finish the job, no matter if the selector is not matching anymore the element that activated them.

I'm realizing today that I was probably wrong.

In the following example, an animation is triggered by the :focus and :active pseudo-classes. Focus on the first textfield:

  • if you press the tab button slowly, you will see the animations starting and ending correctly;
  • if you press the tab button quickly, you will see that once a new element get the focus, the old element's animation immediately ends and disappear.
@-webkit-keyframes pressed {    
    0%, 100% { transform : scale(1); }
         50% { transform : scale(2); }
}
@keyframes pressed {    
    0%, 100% { transform : scale(1); }
         50% { transform : scale(2); }
}
a:focus, a:active {
    -webkit-animation : pressed 2s; 
            animation : pressed 2s; 
}

a, input {
          border : 1px solid silver; 
         padding : 5px;
          height : 40px;
     line-height : 28px;
          margin : 0px;
         display : inline-block;
           width : 33.3%;
      box-sizing : border-box;  
      background : white; 
  vertical-align : middle;
}

a { 
           color : dodgerBlue; 
 text-decoration : none;}

input {
           color : red;
}
<input type="text" id="foo" value="Start here, then press tab" /><a  href = "#">
Lorem
</a><a  href = "#">
Ipsum
</a><a  href = "#">
dolor
</a><a  href = "#">
sit
</a><a  href = "#">
amet
</a><a  href = "#">
consectetur 
</a><a  href = "#">
adipiscing 
</a><a  href = "#">
elit
</a>

I know I can make it end smoothly (on some browser, eg. Firefox yes, Chrome no) by applying:

    a { transition: all 2s ease; }

so that if it's loaded up to (for example) 40%, it will animate back from 40% to 0% instead of immediately dropping to 0%.

- I also know that I can use jQuery animations instead of CSS3 animation and make it work that way; (EDIT: according to the comment, not even jQuery animations will work this way, if I got that right)

What I'm asking here, as a CSS3 Animation newbie, is:

is there a pure CSS3 way to force the animation to run up to 100%, no matter if the initial condition is not valid anymore ?



via Chebli Mohamed

Slide down navigation with list items moving

I have a navigation that slides down in a way that background color slides down and the list items fade in, but are not moving from the top downwards and that is what i would like to achieve.

Must be simple by adding a top value with addClass/removeClass, but can't seem it to work within the javascript.

Note: .nav-toggle is the hamburger icon which is the trigger that works fine.

Hope someone can help me.

--> Fiddle

Javascript:

// Navigation //

$(function() {
$('.nav-toggle').click(function() {
    event.preventDefault();
    $('nav ul.right-nav').slideFadeToggle(300);
    $('.nav-toggle').toggleClass('is-active');
})
});

$(window).scroll(function() {
if ($(this).scrollTop() > 50) {
    $('nav ul.right-nav').hide();
    $('.nav-toggle').removeClass('is-active');
}
});

$.fn.slideFadeToggle  = function(speed, easing, callback) {
return this.animate({opacity: 'toggle', height: 'toggle'}, speed,  easing, callback);
}; 

Html:

<header>
<nav>
    <div class="mobile-nav">
        <div class="nav-toggle"><i class="nav-icon"></i></div>
    </div>
    <ul class="left-nav">   
        <li class="home"><a href="#">Pixelation</a></li>    
    </ul>
    <ul class="right-nav">  
        <li><a href="#">Work</a></li>
        <li><a href="#">About</a></li>
        <li><a href="#">Contact</a></li>
    </ul>
</nav>
</header>



via Chebli Mohamed

How to make bootstrap columns the same height in a row?

http://ift.tt/1M8gZKp Here is the bootply for my website, basically I want the cols col-lg-6 to be the same height so that the images I have inside them are even, at the moment, one image stretches below the other one.

Edit: Current version http://ift.tt/1P3LcZl



via Chebli Mohamed

web api start html page

I have web api project and I have *.html page and I need run it after run my project but I don't know how do it. In MVC I use MapRoute like this:

  routes.MapRoute(
        name: "Default",
        url: "{controller}/{action}/{id}",
        defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
    );

But I don't know how do it in web api. I have next routes config:

config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{action}/{id}", new { id = RouteParameter.Optional });

and how to add other config for run my html page? Thanks.



via Chebli Mohamed

Horizontally aligning textbox with label when the two are in different divs

I am trying to align a series of text boxes with their corresponding labels. Since they are in two different divs, I am unable to use the inherit keyword. I have tried using the javascript/jquery code below to align the pairs of elements, but $(tb).css('left') just returns auto. Does anyone know how to achieve this alignment using html, css, and/or javascript/jquery and without using a table?

$(function() {
    $('#infoLabels label').each(function(idx,lbl) {
        var tb = $('#' + lbl.htmlFor);

        ($(tb).width() > $(this).width()) ? $(this).width($(tb).width()) : $(tb).width($(this).width());
        $(this).css('left',$(tb).css('left'));                
    });
});

http://ift.tt/1JK3Fdj

Thanks in advance.



via Chebli Mohamed

Change Breakpoint in Skeleton CSS

I'm looking to change the breakpoints in Skeleton CSS grid. Essentially I want the right hand column to stack underneath the left six columns once the browser hits 1000px. Here is sample code of what I'm working with:

<section>
    <div clas="container">
        <div class="row">
            <div class="six columns">
                <h2>Lorem Ipsum Dolar</h2>
            </div>
            <div class="five columns offset-by-one">
                This is my fifth column that I want to be positioned under the six columns area when the browser screen hits 1000px. This should be full width as well.
            </div>
        </div>
    </div>
</section>

Any thoughts on how to do this? Or should is it possible to set up a media query to make the left five columns stack under the first six?



via Chebli Mohamed

CSS Drop-down menu: second level positioning?

So I'm working on a CSS drop down menu where the div container is revealed by a radio button and I have that working as I'd like.

However, I'd like to add a second level to my drop-down just like it (same width, positioning beneath parent, ect..) I have it revealing the second level when you click on the input, however, If the input is in the middle (in between two links) my first level's links move beneath my first level of sub-menu. Please help? I can't figure out how to keep it looking the same way it's just if that input has another sub menu I would like for it to drop down below the first.

My code:

/*CSS for Menu */
.menu {
  position: fixed;
  top: 0;
  left: 0;
  height: 20px;
  width: 100%;
  z-index: 10000;
  display: inline-block;
  background-image: black url(../images/glossyback.gif);
  background-color: #0066CC;
  text-align: center;
  font-family: Arial, Geneva, sans-serif;
}
/*CSS for main menu labels */

input + label {
  color: #FFFFFF;
  display: inline-block;
  padding: 6px 8px 10px 24px;
  background-image: black url(../images/glossyback2.gif);
  height: 8px;
  margin: 0;
  line-height: 12px;
  position: relative;
}
input:hover + label:hover {
  background: #3385D6;
}
input + label + div {
  margin: 0;
  margin-top: 2px;
  padding: 16px;
  border: 1px solid;
  width: 100%;
  height: auto;
  position: absolute;
  top: 20px;
  display: none;
}
input:checked + label + div {
  display: block;
}
/*CSS for main menu labels within menu class*/

.menu input {
  display: none;
  opacity: .3;
  margin-right: -.7em;
  margin-left: 0em;
  overflow: visible;
}
.menu a {
  text-decoration: none;
  color: #FFFFFF;
}
.menu label span {
  z-index: 1000;
  font-size: 12px;
  line-height: 9px;
  padding: 6px 1em 12px 1em;
  display: block;
  margin-top: -1px;
  background-image: url(../images/glossyback.gif) repeat-x bottom left;
}
.menu label span a:hover {
  background-image: black url(../images/glossyback2.gif);
}
.menu input:checked + label {
  background-color: #AFCEEE;
  border-color: #6696CB;
  z-index: 1000;
}
div.menu input + label {
  z-index: 1000;
  padding: 0;
  border-color: #ccc;
  border-width: 0 1px;
  height: 19px;
  margin: 0 -.23em;
}
/*CSS for submenu container  */

.menu input + label + div {
  position: absolute;
  border: 1px solid #808080;
  right: 0;
  background: #F0F6FC;
  text-align: center;
  width: 100%;
  margin: 0 auto;
}
.menu input + label + div > div {
  z-index: 1000;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 1px solid #ABABAB;
  padding: 16px;
  padding-top: 5px;
}
/*CSS for sub menu items*/

.sub-menu {
  font-size: 14px;
  display: inline-block;
}
.sub-menu a {
  text-decoration: none;
  color: #EEEEEE;
}
.sub-menu ul {
  list-style-type: none;
}
.sub-menu li {
  width: 175px;
  color: #F0F0F0;
  background-color: #9CB9D7;
  display: inline-block;
}
.sub-menu li:hover {
  color: #FFFFFF;
  text-decoration: none;
  background-color: #3385D6;
}
/*CSS for sub-menu second level */

.sub-menu input[type=radio] {
  display: none;
}
.sub-menu input[type=radio]:checked ~ .remove-check {
  display: none;
}
.sub-menu input[type=radio]:checked ~ #second-level {
  display: block;
}
#second-level {
  display: none;
}
/*  The styling of items, ect...*/

.sub-menu input[type=text] {
  width: 225px;
  padding: 12px 14px;
}
.sub-menu div {
  border: 1px solid #808080;
  right: 0;
  background: #F0F6FC;
  text-align: center;
  width: 100%;
  margin: 0 auto;
}
.sub-menu div div {
  top: 90%;
  z-index: 1000;
  position: absolute;
  border: 1px solid #ABABAB;
  padding: 16px;
  padding-top: 5px;
}
.sub-menu .second-level-items {
  width: 175px;
  color: #F0F0F0;
  background-color: #9CB9D7;
  display: inline-block;
}
<div class="menu">
  <input type="radio" name="UItab" id="tabf">
  <label for="tabf"><span>Styles</span>
  </label>
  <div>
    <div>
      <ul class="sub-menu">
        <a href="">
          <li id="linkj">First Link</li>
        </a>
        <label for="reveal-email">
          <li>Tab in submenu</li>
        </label>
        <input type="radio" id="reveal-email">
        <div id="second-level">
          <div>
            <a href="">
              <li>Links2.0</li>
            </a>
          </div>
        </div>
        <label for="reveal-email">
          <li>Tab in submenu</li>
        </label>
        <input type="radio" id="reveal-email">
        <div id="second-level">
          <div>
            <a class="second-level-items" href="">
              <li>Links2.0</li>
            </a>
          </div>
        </div>
        <a href="">
          <li id="linkj">First Link</li>
        </a>
    </div>
  </div>
</div>


via Chebli Mohamed

Table with enumerated rows except the last one

How can I have a table with numerated rows except the last row? I was trying below code but it does not work :(

EDIT: Below code works in Chrome and Firefox but not in Safari. I don't know about IE yet

table.enumerated {
    counter-reset: rowNumber;
}

table.enumerated > tbody > tr {
    counter-increment: rowNumber;
}

table.enumerated > tbody > tr > td:first-child::before {
    content: counter(rowNumber);
    min-width: 1em;
}
table.enumerated > tbody > tr:last-child > td:first-child::before {
    content: unset;
}
<table border="1" class="enumerated">
    <tr>
        <td></td><td>one</td>
    </tr>
    <tr>
        <td></td><td>two</td>
    </tr>
    <tr>
        <td></td><td>three</td>
    </tr>
    <tr>
        <td class='no-number'></td><td>no number</td>
    </tr>
</table>


via Chebli Mohamed

How to style more than one ul

I'm using the CSS lines below for a menu on a webpage.

The problem is that I don't know how to make that code apply only to the menu, and not to other ul -unordered lists- on the page!

ul {
text-align: left;
display: inline;
margin: 0;
padding: 15px 4px 17px 0;
}

ul li {
font: bold 12px/18px sans-serif;
display: inline-block;
margin-right: -4px;
position: relative;
padding: 15px 20px;
background: #AAF7BB;
font-size: 110%;
}

ul li:hover {
background: #ffffff;
color: #000000;
}
ul li ul {
padding: 0;
position: absolute;
top: 48px;
left: 0;
width: 150px;  
opacity: 0;
visibility: hidden;
}
ul li ul li { 
background: #ffffff; 
display: block; 
color: #00ff00; 
}

ul li ul li:hover { background: #ffffff; }

ul li:hover ul {
display: block;
opacity: 1;
visibility: visible; 
}
a:link {
text-decoration: none;
}

a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}

a:active {
text-decoration: none;
} 

Please help.



via Chebli Mohamed

how to pass variables though javascript to ajax using jquery-tabledit?

I am currently using the jquery plugin Tabledit and when i use an inline edit as in example 3 it calls my php page. I have no idea how to pass the changes I made in the edit to the new php page so i can change it in the database. it changes when you hit enter. (im guessing on enter it calls the edittask.php)

html here is one section of the table. it changes on hitting enter after you type in new text.

<td class="tabledit-view-mode"> <span class=" tabledit-span ">header text</span>
    <input class="tabledit-input form-control input-sm" type="text" name="description" value=" " style="display: none;" disabled="" />
</td>

javascript

$('#thetable').Tabledit({
    url: 'editTask.php',
    editButton: false,
    deleteButton: false,
    columns: {
        identifier: [0, 'id'],
        editable: [
            [1, 'Header'],
            [2, 'Description']
        ]
    }
});



via Chebli Mohamed

jquery - click on table row to append value in checkboxes

JS

$(document).ready(function() {

  $('.tg tr.data-list-row[name=data-list-row]').click(function() {
    var currentId = $(this).closest('tr').attr('id');
    $.getJSON('<%=request.getContextPath()%>/ws/booking/getpriceinput_by_id/' + currentId, function(data) {
      $("#current_typetarif_id").val(data.id);
      $("#inputName").val(data.libelle);
      $("#inputCode").val(data.code);
      $("#inputTarif").val(data.montantTarifDefaut);
    });
  });

  

});
<div class="table-responsive">
  <table class="table tg" style="table-layout: fixed; width: 745px">
    <colgroup>
      <col style="width: 249px">
        <col style="width: 249px">
          <col style="width: 249px">

    </colgroup>

    <thead>
      <tr>
        <th class="tg-s6z2 bdleft">NOM</th>
        <th class="tg-s6z2">CODE</th>
        <th class="tg-s6z2">PRIX PAR DEFAUT</th>
      </tr>
    </thead>
    <tfoot>
    </tfoot>
    <tbody>
      <tr>
        <td colspan="5">
          <div class="scrollit">
            <table class="table tg" style="table-layout: fixed;">
              <colgroup>
                <col style="width: 220px">
                  <col style="width: 240px">
                    <col style="width: 240px">
              </colgroup>


              <c:forEach items="${type_tarif_list}" var="type_tarif" varStatus="loop">
                <tr class="data-list-row" name="data-list-row" id="${type_tarif.id}" style="cursor: pointer;">
                  <td class="tg-s6z2 bdleft">${type_tarif.libelle}</td>
                  <td class="tg-s6z2">${type_tarif.code}</td>
                  <td class="tg-s6z2">${type_tarif.montantTarifDefaut}</td>
                  <td class="deleterow bdryt" id="${type_tarif.id}" name="del_button">
                    <div class="glyphicon glyphicon-remove" title="Supprimer"></div>
                  </td>
                </tr>
              </c:forEach>
            </table>
          </div>
        </td>
      </tr>
    </tbody>
  </table>
</div>

<form class="form-horizontal" style="margin: 0 auto; width: 150px;" id="scrollit" name="thisForm">
  <c:forEach items="${option_tarif_list}" var="option_tarif" varStatus="loop">
    <div class="checkbox1">
      <label>
        <input type="checkbox" name="tarif_inclue" value="${option_tarif.libelle}" class="checkboxchk" id="option_tarif_chk_${option_tarif.id}">${option_tarif.libelle}
      </label>
    </div>
  </c:forEach>

</form>

JSON value extracted from database

{
  "id": 1,
  "code": "0001",
  "libelle": "TARIF PUBLIC",
  "montantTarifDefaut": 10.00,
  "tarifTypeList": [
    {
      "chambreTypeId": 1,
      "tarifTypeId": 1
    }
  ],
  "tarifTypeOptionList": [
    {
      "typeTarifId": 1,
      "tarifOptionId": 1
    },
    {
      "typeTarifId": 1,
      "tarifOptionId": 2
    },
    {
      "typeTarifId": 1,
      "tarifOptionId": 3
    }
  ]
}

Hi.

This block of code below make a select in the table row to display values into the texts fields.

    $(document).ready(function() {

  $('.tg tr.data-list-row[name=data-list-row]').click(function() {
    var currentId = $(this).closest('tr').attr('id');
    $.getJSON('<%=request.getContextPath()%>/ws/booking/getpriceinput_by_id/' + currentId, function(data) {
      $("#current_typetarif_id").val(data.id);
      $("#inputName").val(data.libelle);
      $("#inputCode").val(data.code);
      $("#inputTarif").val(data.montantTarifDefaut);
    });
  });



});

On clicking on the table row, i need to display the checked values in the checkbox. According to the id selected in the rows, specific values will be checked in the checkboxes. Those values are being extracted from a database through a JSON file. I should extract it using the value (data.tarifOptionId)

I think is should be put it in a loop, so that the id value is incremented when each table row is clicked. The id of the input is #option_tarif_chk_, and it is embeded in a cforeach loop.

I have written something like this below:

            $.each(data, function(i, item) {
                alert(item.tarifTypeOptionList[0].tarifOptionId);
            });

But it is not working. The alert returns Uncaught TypeError: Cannot read property '0' of undefined

Any help will be much appreciated.

Thank you



via Chebli Mohamed

Django forms extra empty radio button

In rendering a model form an extra radio button is produced and I don't know where it's coming from:

>>> f = DocumentForm()
>>> print f['document_type']
<ul id="id_document_type">
<li><label for="id_document_type_0"><input checked="checked" id="id_document_type_0" name="document_type" type="radio" value="" /> ---------</label></li>
<li><label for="id_document_type_1"><input id="id_document_type_1" name="document_type" type="radio" value="1" /> Campus LAN</label></li>
<li><label for="id_document_type_2"><input id="id_document_type_2" name="document_type" type="radio" value="2" /> WAN</label></li>
<li><label for="id_document_type_3"><input id="id_document_type_3" name="document_type" type="radio" value="3" /> UC</label></li>
</ul>

That first radio button with value="" and the text as ---------, I've scoured my code and can't work out where it originates from?

models.py

class DocumentType(models.Model):
    name = models.CharField("Document Type", max_length=240)

class Document(models.Model):
    document_type = models.ForeignKey(DocumentType,
                                      verbose_name="Document Type")

>>> DocumentType.objects.all()
[<DocumentType: Campus LAN>, <DocumentType: WAN>, <DocumentType: UC>]
>>> d = Document.objects.all()
>>> for x in d:
...     print x.document_type
... 
Campus LAN
Campus LAN



via Chebli Mohamed

How to make table cells square for any amount of text in it when table is overflow?

A Simple Problem: When table is wider than screen and if we add a bigger text in any cell or <td>.

It will increase the height for whole row unnecessary extra


Case 1 (no problem) (only table overflow): (http://ift.tt/1gHeQIA)

Case 2 (no problem) (only a cell with more text): (http://ift.tt/1P3HfDX)

Case 3 (PROBLEMATIC) (overflow + a cell with more text): (http://ift.tt/1gHeQIG)


Solution I Think (i tried javascript but fail) : If we somehow just add 1 property to be square shaped to all table cells (in case we add larger text, it will resize but keep square shape), because square shape will make table to take least area possible.

I know some people will help so thanks in advance for help...



via Chebli Mohamed

Where is code located wordpress

I was told that in my theme oxygen which I am using for woocommerce that I needed to change the html in the following on the category page but I cannot for the life of me find it.

<div class="main">
<div class="laborator-woocommerce shop">
    <div class="row">...</div>
    <div class="codenegar-shop-loop-wrapper">
        <div class="row">...</div>
        <!-- Here is the problem -->
        <div class="row">...</div>
        <!-- Here is the problem -->
        <div class="col-md-3 sidebar-env">...</div>
    </div>
</div>

Change to

<div class="main">
    <div class="laborator-woocommerce shop">
        <div class="row">...</div>
        <div class="codenegar-shop-loop-wrapper">
            <div class="row">...</div>
            <!-- Here is the change -->
            <div class="col-md-9">...</div>
            <!-- Here is the change -->
            <div class="col-md-3 sidebar-env">...</div>
        </div>
    </div>
 </div>

If you have a look at the source here http://ift.tt/1I8opJq you can see what I am trying to fix is the sidebar floating to bottom the below does fix it but i cant see how row is being generated in the source



via Chebli Mohamed

How to hide an element until script animation is applied

how can i show a < script > in html before the page load the content?

<script>
    function startTime() {
        var today=new Date();
        var h=today.getHours();
        var m=today.getMinutes();
        var s=today.getSeconds();
        m = checkTime(m);
        s = checkTime(s);
        document.getElementById('uhrzeit').innerHTML = h+":"+m+":"+s;
        var t = setTimeout(function(){startTime()},500);
    }   

    function checkTime(i) {
        if (i<10) {i = "0" + i};  // add zero in front of numbers < 10
        return i;
    }
</script>

the first one just shows the time of day... more important is the second part. At the moment the website is loading the content and shows me the Edge-Animate animation after the content is complete loaded. And you may mention it sucks that the animation comes after paged is loaded...

<!--Adobe Edge Runtime-->
<script>
    var custHtmlRoot="hin-aktuell/Assets/"; 
    var script = document.createElement('script'); 
    script.type= "text/javascript";
    script.src = custHtmlRoot+"edge_includes/edge.6.0.0.min.js";
    var head = document.getElementsByTagName('head')[0], done=false;
    script.onload = script.onreadystatechange = function(){
    if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) {
        done=true;
        var opts ={
            scaleToFit: "none",
            centerStage: "none",
            minW: "0px",
            maxW: "undefined",
            width: "100%",
            height: "100%"
        };
        opts.htmlRoot =custHtmlRoot;
        AdobeEdge.loadComposition('hin-aktuell', 'EDGE-2489594', opts,
        {"dom":{}}, {"dom":{}});        
        script.onload = script.onreadystatechange = null;
        head.removeChild(script);
    }
};
    head.appendChild(script);
</script>



via Chebli Mohamed

Form won't submit when showing certain fields

I am trying to create a drop down menu that allows a user to select which area they would like to login to. Currently, the drop down feature works and hides whichever areas the user is not logging into and shows only the area that they have selected. Using just the form without the dropdown works great and opens a new window while also logging the user in to the system. However, when I add the dropdown menu and surround the form in tags, it allows me to enter the data but does not process the data.

If possible I would also like to have the form open a new tab in the current browser window(not in a completely new window).

-I cannot change the forms at all besides things that won't matter because they have been given to me from an external source.

Here is my code:

$(document).ready(function() {
  toggleFields(); //call this first so we start out with the correct visibility depending on the selected form values
  //this will call our toggleFields function every time the selection value of our repository field changes
  $("#member").change(function() {
    toggleFields();
  });

});
//this toggles the visibility of the 3 different forms depending on which repository the user is logging into.
function toggleFields() {
  if ($("#member").val() == 1)
    $("#depo").show();
  else
    $("#depo").hide();
  if ($("#member").val() == 2)
    $("#records").show();
  else
    $("#records").hide();
  if ($("#member").val() == 3)
    $("#reporter").show();
  else
    $("#reporter").hide();
}
<script src="http://ift.tt/1qRgvOJ"></script>

<select id="member" name="member">
  <option value="0">---</option>
  <option value="1">Deposition Repository</option>
  <option value="2">Records Repository</option>
  <option value="3">Reporter Area</option>
</select>

<div id="depo">
  <p>Login to Access your Deposition Repository</p>
  <p>
    <script type="text/javascript" src="http://ift.tt/1P3HeQs"></script>
    <form name="frmrbwebattorney" method="post" action="http://ift.tt/1P3Hdw0">
      User ID:
      <input type="text" name="rbwebuserid" style="width:130px;" value="" maxlength=30>Password:
      <input type="password" name="rbwebpassword" style="width:130px;" value="" maxlength=65 onkeypress="javascript:if(event.keyCode ==13) login(document.frmrbwebattorney,1);">
      <INPUT type="button" value="Log In" style="font-size:11px;" style="width:64px" onclick="javascript:login(document.frmrbwebattorney,1);" id=btnptarbweb name=btnptarbweb>
      <INPUT type="hidden" name="appname" value="">
      <INPUT type="hidden" name="os" value="">
    </form>
  </p>
</div>

<div id="records">
  <p>Login to Access your Records Repository.</p>
  <p>
    <script type="text/javascript" src="http://ift.tt/1gHeNwv"></script>
    <form name="frmrbwebattorney" method="post" action="http://ift.tt/1P3HeQu">
      User ID:
      <input type="text" name="rbwebuserid" style="width:130px;" value="" maxlength=16>Password:
      <input type="password" name="rbwebpassword" style="width:130px;" value="" maxlength=65 onkeypress="javascript:if(event.keyCode ==13) login(document.frmrbwebattorney,1);">
      <INPUT type="button" value="Log In" style="font-size:11px;" style="width:64px" onclick="javascript:login(document.frmrbwebattorney,1);" id=btnptarbweb name=btnptarbweb>
      <INPUT type="hidden" name="appname" value="">
      <INPUT type="hidden" name="os" value="">
    </form>
  </p>
</div>

<div id="reporter">
  <p>Login to the Reporter Area.</p>
  <p>
    <script type="text/javascript" src="http://ift.tt/1P3HeQs"></script>
    <form name="frmrbwebreporter" method="post" action="http://ift.tt/1gHeNwx">
      User ID:
      <input type="text" name="rbwebuserid" style="width:130px;" value="" maxlength=16>Password:
      <input type="password" name="rbwebpassword" style="width:130px;" value="" maxlength=65 onkeypress="javascript:if(event.keyCode ==13) login(document.frmrbwebreporter,1);">
      <INPUT type="button" value="Log In" style="font-size:11px;" style="width:64px" onclick="javascript:login(document.frmrbwebreporter,1);" id=btnptarbweb name=btnptarbweb>
      <INPUT type="hidden" name="appname" value="">
      <INPUT type="hidden" name="os" value="">
    </form>
  </p>
</div>

Any help will be greatly appreciated!



via Chebli Mohamed

CSS or jQuery hover effect to increase a fixed box and show absolute position larger version

does anyone know how i can make my colour boxes increase in size (in same position, guessing absolute position so it does not effect the other positions of colours) when you hover will show a larger version of the colour when you hover... maybe background image size? dont know.

I have added a image for a test on the red one.

#product_color_select li {
        display: inline-block;
        width: 30px;
        height: 25px;
        text-indent: -999999em;
        cursor: pointer;
}
/* interior colours */
#product_color_select li.eco-weave {
        background-color: #beaaaa;
}
#product_color_select li.aubergine-dream {
        background-color: #382643;
}
#product_color_select li.lime-citrus {
        background-color: #99a366;
}
#product_color_select li.blue-jazz {
        background-color: #435fa1;
}
#product_color_select li.sakura-pink {
        background-color: #bf3253;
}
#product_color_select li.hot-chocolate {
        background-color: #3b2b28;
}
#product_color_select li.tundra-spring {
        background-color: #c5c1d0;
}
#product_color_select li.black-sapphire {
        background-color: #131114;
}
#product_color_select li.luscious-grey {
        background-color: #7a6772;
}
#product_color_select li.wildberry-deluxe {
        background-image: url('http://ift.tt/1gHeNg4');
}
<ul class="fabric-select" id="product_color_select">
    <li class=" eco-weave" data-value="742" title="Eco Weave">Eco Weave</li>
    <li class=" blue-jazz" data-value="749" title="Blue Jazz">Blue Jazz</li>
    <li class=" sakura-pink" data-value="743" title="Sakura Pink">Sakura Pink</li>
    <li class="selected luscious-grey" data-value="744" title="Luscious Grey">Luscious Grey</li>
    <li class=" lime-citrus" data-value="748" title="Lime Citrus">Lime Citrus</li>
    <li class=" hot-chocolate" data-value="741" title="Hot Chocolate">Hot Chocolate</li>
    <li class=" black-sapphire" data-value="746" title="Black Sapphire">Black Sapphire</li>
    <li class=" wildberry-deluxe" data-value="727" title="Wildberry Deluxe">Wildberry Deluxe</li>
    <li class=" tundra-spring" data-value="747" title="Tundra Spring">Tundra Spring</li>
    <li class=" aubergine-dream" data-value="745" title="Aubergine Dream">Aubergine Dream</li>
</ul>

Thanks in advance



via Chebli Mohamed

displaying div side by side

I am having some issues trying to display my <div checkoutoptionsto the right and my <div productdetailsto the left of checkoutoptions

Here is how it is displaying nowis displaying now:

Here is how I would like it to display with the panels named

It looks like there is some kind of wrapping around the div checkoutoptionsthat won't let me move the div productdetails upbut I have not idea how to correct the issue.

Here is a link to my website as an example if you would like to see it first hand.

Here is my HTML:

    <!-- Share and title/show this panel on top -->


        <div class="ProductMain" style= "float: left; "> 
            <h1 itemprop="name">%%GLOBAL_ProductName%%</h1>

            %%GLOBAL_FacebookLikeButtonAbove%%
            %%GLOBAL_FacebookLikeButtonBelow%%
            %%GLOBAL_PinterestButton%%


            <!--side panel with add to cart show this panel to the right-->

            <div id="checkoutoptions">

               %%SNIPPET_ProductAddToCartRight%%
               <div><input id="ShopButton" style="display: none";></div>


               %%SNIPPET_ProductAddToCartBelow%%
               %%Panel.SideProductAddToWishList%%


                          <div class="WishlistRow DetailRow" style="display:%%GLOBAL_HideWishlist%%">
                              <a class="WishListButton" href="javascript: void(0)">ADD TO WISHLIST</a>

                </div>

                              %%GLOBAL_AddThisLink%%

            </div>


            <!--Yotpo Reviews/ display this panel next to checkoutoptions to the left and right under ProductMain-->

            <div id="productdetails">

<div style="padding: 0px 0px 0px; width: 200px; margin: auto; height: 00px"> </div><!--yotpo product rating-->

 <div class="yotpo bottomLine"
 data-product-id="%%GLOBAL_ProductId%%"
 data-url="%%GLOBAL_ProductLink%%">
    </div> 


            <div class="ProductDetailsGrid">
                <div class="DetailRow RetailPrice" style="display: %%GLOBAL_HideRRP%%">
                    <span class="Label">%%LNG_RRP%%:</span>
                    %%GLOBAL_RetailPrice%%
                    %%GLOBAL_YouSave%%
                </div>
</div>

Here is my CSS so far:

#checkoutoptions{
    margin:auto;
    padding: 10px;
    border-radius: 5px;
    width: 310px;
    border: 1px solid gray;
}



via Chebli Mohamed

Displaying tables like Excel

I'm working on a web app using servlet and JSP. I have two tables and I want to display them in my page like in Excel.
For exemple when a click on "Table 1" ,Like in excel sheets, The table 1 will be displayed and the same for table 2. Does somebody know how can I do it ? It may be done with Jquery, but I don't know how. Thank you for your help.



via Chebli Mohamed

foreach every 3 put inside a new ul

Actually I have this foreach loop:

<ul>
    <?php foreach ( $tasks as $task ) { ?>
        <li>
            ...
        </li>
    <?php } ?>
</ul>

It returns:

<ul>
    <li>...</li>
    <li>...</li>
    <li>...</li>
    <li>...</li>
    ...
</ul>

Now I need to change the loop to put every 3 <li> into a new <ul>, so I can have:

<div>
    <ul>
        <li>...</li>
        <li>...</li>
        <li>...</li>
    </ul>
    <ul>
        <li>...</li>
        <li>...</li>
        <li>...</li>
    </ul>
    ...
</div>

How I have to modify the foreach loop to achieve that result?



via Chebli Mohamed

how to add html menu into custom theme in wordpress with links

<ul class="menu">
    <li>
        <a href="<?php echo home_url()?>">
            <img class="img-responsive" src="<?php echo get_bloginfo('template_url') ?>/images/bloom_logo.png" />
        </a>
    </li>
    <li style="visibility:hidden;">---</li>
    <li>
        <a href="<?php echo home_url()?>/cart.php" >
            <span class="glyphicon glyphicon-shopping-cart"></span>Cart
        </a>
    </li>
    <li><a href="<?php echo home_url()?>/index.php">Home</a></li>
    <li><a href="<?php echo home_url()?>/catalog.php">Catalog</a></li>
    <li><a href="<?php echo home_url()?>/blog.php">Blog</a></li>
    <li><a href="<?php echo home_url()?>/about_us.php">About Us</a></li>
</ul>



via Chebli Mohamed

Is there a way to make a appear when a button is selected and the display is none, using JavaScript or any other language?

I am having some trouble here. I am developing a button that once selected will run a JavaScript function - ShowColumn() - that will make a table column appear. The table column will at first be hidden - "display:none;" - but once the user selects the button the table column that is hidden will then appear/will be visible. Can this be done? And if so please can someone help? Thanks :)

I have included what I have done so far, as follows:

<html>
  <head>
    
    
    <script type="text/Javascript">
      
      function ShowColumn(){
        
            document.getElementById("hiddenColumn").style.display = ""; 
        
        }
      
    </script>
    
    
  </head>
  <body>
    
    <button onClick="ShowColumn()"></button>
    
    <table>
      <tr>
         <td>
           <textarea>Write something here....</textarea>
         </td>
        <td id="hiddenColumn" style="display:none;">
           <textarea>Write something here....</textarea>
         </td>
      </tr>
    </table>  
      
      
  </body>
</html>

I have done a lot of research and I haven't come up with any solution to my problem. Can this be done with JavaScript and HTML alone? Or do I have to incorporate another language into the system in order to make the hidden column visible? Any help would be highly appreciated! Thanks



via Chebli Mohamed

How do I use a code more than once using dynamic pages?

i'm using this tutorial in order to change the content of my pages without refreshing the page. http://ift.tt/1P3HsXU

It's working pretty fine (the pages do change) but, the content I wanna replace is a showcase using this plugin : http://ift.tt/q9Eo6i

When I first load the page, everything works fine but, when I open another page, the content is replace but the code that transform this content into a showcase is not applied so I only have staked images and no showcase.

So, I was wondering if there was any way to trigger the js file without refreshing the whole page.



via Chebli Mohamed

makeText Sprite error in three.js

I am getting error while adding text in the sprite,how can i over come this error, thanks in advance.

var spritey = makeTextSprite( " Hello, ", 
         { fontsize: 24, borderColor: {r:255, g:0, b:0, a:1.0}, backgroundColor: {r:255, g:100, b:100, a:0.8} } );
spritey.position.set(-85,105,55);
scene.add( spritey );



via Chebli Mohamed

In an HTML/JavaScript file, how can I select a data file to include?

I have written a graphing program, but each time it runs it should prompt the user for a data file to plot. Here is a very simplified program that has the data file (Data.js) hard coded in line 7:

<!DOCTYPE html>
<html>
  <head>
    <title>Warm-up</title>

    <script src="http://ift.tt/PL93nT"></script/>
    <script src="./Data.js"></script>

    <script>

      function drawHorizontalLine(c, startX, startY, endX, endY) {
        c.lineWidth = 3;
        c.strokeStyle = '#888';

        c.beginPath();
        c.moveTo(startX, startY);
        c.lineTo(endX, endY);
        c.stroke();
      }


      $(document).ready(function() {
        // Set the canvas width according to the length of time of the recording
        var myCanvas = document.getElementById("graph");
        var resultOfCalculation = 100;
        myCanvas.width += resultOfCalculation;

        graphWidened = $('#graph');
        var graphCanvas = graphWidened[0].getContext('2d');

        drawHorizontalLine(graphCanvas, 10, 20, endWidth, endHeight);
      });
    </script/>
  </head>

  <body>
    <canvas id="graph" width="600" height="450">
  </body>
</html>

... where Data.js contains:

var endWidth = 200;
var endHeight = 150;

But I want to select the data file, something like this, perhaps:

<input type="file" id="sourcedFile" />
<p id="chosenFile" ></p>

<script type="text/javascript">
  function readSingleFile(evt) {
    //Retrieve the first (and only!) File from the FileList object
    var f = evt.target.files[0];

    if (f) {
      document.getElementById("chosenFile").innerHTML = f.name;
    } else {
      alert("Failed to load file");
    }
  }

  document.getElementById('sourcedFile').addEventListener('change', readSingleFile, false);
</script>

But I am having difficulty fitting the two pieces together in one file. Obviously it should first request the data file and then draw the graph using the file name stored in the "chosenFile" variable. I am new to HTML and JavaScript.

Thanks.

--- Edit ---

Thanks for your response, @TheGr8_Nik. I incorporated it in this file:

<!DOCTYPE html>
<html>
  <head>
    <title>Warm-up</title>
    <input type="file" id="sourcedFile" />
    <p id="chosenFile" ></p>
    <script src="http://ift.tt/1E2nZQG"></script>

<script type="text/javascript">
      function readSingleFile(evt) {
        //Retrieve the first (and only!) File from the FileList object
        var f = evt.target.files[0];

    if (f) {
          document.getElementById("chosenFile").innerHTML = f.name;
        } else {
          alert("Failed to load file");
        }
      }

  document.getElementById('sourcedFile').addEventListener('change', readSingleFile, false);
    </script>

<script>

  function drawHorizontalLine(c, startX, startY, endX, endY) {
        c.lineWidth = 3;
        c.strokeStyle = '#888';

    c.beginPath();
        c.moveTo(startX, startY);
        c.lineTo(endX, endY);
        c.stroke();
      }

$(function() {
        $('#sourcedFile').on( 'change', function () {
          var script,
              script_id = 'loaded_script',
              //file_name = "./Data.js";
              //file_name = "http://ift.tt/1P3Huip";
              //file_name = this.value.replace("C:\\fakepath\\", "");
              file_name = this.value;

      // check if the name is not empty
          if ( file_name !== '' ) {
            // creates the script element
            script = document.createElement( 'script' );

        // assign an id so you can delete id the next time
            script.id = script_id;

        // set the url to load
            script.src = file_name;

        // Draw the graph
            //script.onload = function () {
              var myCanvas = document.getElementById("graph");
              var resultOfCalculation = 100;
              myCanvas.width += resultOfCalculation;

          graphWidened = $('#graph');
              var graphCanvas = graphWidened[0].getContext('2d');

          drawHorizontalLine(graphCanvas, 10, 20, endWidth, endHeight);
              //drawHorizontalLine(graphCanvas, 10, 20, 400, 80);
            //};

        // remove the last loaded script
            $('#'+ script_id ).remove();
            // append the new script in the header
            $('head').append( $(script) );
          }
        });
      });
    </script/>

</head>

<body>
    <canvas id="graph" width="600" height="450">
  </body>
</html>

I run this on a local Windows machine with Chrome browser. Chrome changed the path of the selected file to C:\fakepath\. I tried getting around this problem by creating a "fakepath" directory and putting a copy of the file-to-be-sourced in that directory, but the script said "Cross origin requests are only supported for protocol schemes: http, .....". An internet search suggested running a web server app in Chrome, which I tried. This gave my files the following addresses: http : // 127.0.0.1:8887/Test.html (spaces in links because my reputation is too low) http : // 127.0.0.1:8887/Data.js The script still didn't work because I didn't know how to navigate the file selector pop-up to http : // 127.0.0.1:8887/Data.js. I got around this by hard-coding the selected file -- file_name = "http : // 127.0.0.1:8887/Data.js"; This finally allowed the script to get to the point where the graph gets drawn, but it failed, complaining that the variable 'endWidth' was not defined. This indicates that the http : // 127.0.0.1:8887/Data.js file (which defines endWidth) was not sourced into the main script.

I then tried a simpler set-up - I moved all the files to c:\fakePath. This allowed me to to select a data file without the script complaining. But, as above, it complained when it tried to draw the graph, indicating that the selected file was not actually included in the source.

Phew! Any ideas? Thanks.



via Chebli Mohamed

How to prevent websites header and footer in android app

I have a website which is built using WordPress, now I want to make an android app which will use this website. I want the header/footer to be dynamic as follows:

User access     | header displayed?
app             | no
android browser | yes

Any idea or suggestions how to do it? Is there any WordPress, android or JavaScript plugin which I can use?



via Chebli Mohamed

how to switch driver control from the top window to iframe#mainFrame

I am using firebug to inspect the xpath, one block of firebug shows the element your finding is in window or iframe and so on. I am facing similar kind of problem where it shows me 2 options 1: Top window 2: iframe#mainframe now the problem is,when i inspect the element it shows in iframe#mainFrame, i tried switching the driver control from main window to iframe and detect the element using webdriver but it didn't work for me,I wrote the following set of code:

driver.switchTo().frame("mainFrame");
driver.findElement(By.xpath("//div[@class='div_img']/img[@src='http://ser/themes/20/3/Flor/CF.jpg']")).click();

Note: when i checked the iframe in the html code,it doesn't contain another document inside it, It only contains id and other style and all and src tag.
Kindly suggest if there is some other way through which i can detect the element.



via Chebli Mohamed

iOS Safari focus on element at the bottom of the page issue

I have an issue with iOS Safari. There is no such issue in Chrome browser.

When focus on the element at the end of a page, keyboard appears and a part of body background is become visible. Has anyone encountered this problem?

HTML Code:

html, body{
  min-height: 100%;
  margin: 0;
  padding: 0;
}
body{
  background-color: #000;
  background-image: url('http://ift.tt/1M8VYz7');
  background-repeat: repeat;
  background-position: 0 0;
  color: #fff;
}
<html>
  <head>
    <title>TODO supply a title</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=640, initial-scale=0.5, minimum-scale=0.5, maximum-scale=0.5, user-scalable=no">
  </head>
  <body>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <div>TODO write content</div>
    <select id="test">
      <option>1</option>
      <option>2</option>
      <option>3</option>
      <option>4</option>
    </select>
  </body>
</html>

Safari screenshots: http://ift.tt/1E63eDS



via Chebli Mohamed

HTML/PHP selecting a value from dropdown menu and retrieving the associated row and output all the data from that row

Its a bit hard to express what I want to do but let me give it a shot.

First of all I have a database with a table. One of the columns from that table I will be showing in a select dropdown menu in HTML, to be more precise: this outputs the column 'name' in the dropbown menu:

<?php
$query = mysql_query("SELECT name from table");

echo "<select name='select1'>";

while ($row = mysql_fetch_array($query))
{
echo "<option value'" . $row['name'] ."'>" . $row['name] . "</option>;
}
echo "</select>";
?>

Then when a value is selected in that dropdown, that value needs to be saved in a variable.

if (isset($_POST['button']))
{
$select = $_POST['select1'];
}

As last bit, the value in variable $select needs to be used to make a SELECT query. I want to use that variable in the SELECT statement to look for the corresponding row (in the same table) that is related to the value in the dropdown menu and pick a column and output that value to a textbox or checkbox, depending on as what the value needs to be outputted.

Example:

TABLE

      id - name - street - number - ...
row 1: 0 - test1 - teststreet1 - 1 - ...
row 2: 1 - test2 - teststreet2 - 2 - ...
row 3: 2 - test3 - tesstreett3 - 3 - ...

1) I select test2 from the dropdown menu (dropdown menu is filled with the column name from database)

2) test2 is saved as a variable in $name

3) select query searches for value of street column where $name = test2

SELECT street from table where ?
row 2: 1 - test2 - tesstreett2 - 2 - ...

So I want teststreet2 from street to be outputted in a textbox

<input type='text' value='?'>

I need help with the select query or how to call this.

Thanks in advance and taking time to read this!

Kind Regards



via Chebli Mohamed

Trying to build Home page for a website that contains a clickable image

I want to make the image clickable and on hover I want to change the background image

<style media="all" type=text/css> 
  body {   
    background: url(http://ift.tt/1E63gf5) no-repeat center fixed;   
    -webkit-background-size: cover;   
    -moz-background-size: cover;  
    -o-background-size: cover;  
    background-size: cover;   
    position: relative; 
  }  
 </style> 



via Chebli Mohamed

Function for AddRow & Popup not working as expected

I am new to the development field. There are two problem with this code. First when I click button for add_Row then a row gets added on screen but it disappears after 1-2 seconds and same thing happens with group_Create() popup.

<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
    <title>Inventory Expert</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width">
    <link rel="stylesheet" href="../../Bootstrap-3.3.2-dist/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="../../CSS/ProductMaster/ProductMaster.css"/>
    <link rel="stylesheet" href="../../CSS/ProductMaster/RawMaterialGroup.css"/>
    <script src="../../JAVASCRIPT/ProductMaster/ProductMaster.js"></script>
    <script src="../../JAVASCRIPT/ProductMaster/RawMaterialGroup.js"></script>
    <script src="../../jquery-1.11.2.js"></script>
    <script src="../../jquery-ui-1.11.2.custom/jquery-ui.js"></script>
    <script src="../../jquery-ui-1.11.2.custom/jquery-ui.min.js"></script>
</head>
<body>
    <img id="top" src="../../Images/shaddow_line_top.png" alt=""/>
    <div class="container">
        <h1><a>Product Master</a></h1>
        <form id="productmasterForm">
            <table class="table" id="productmasterTable">
                <tr>
                    <td class="W45">Product Code <input id="productid" type="text"/></td>
                    <td class="W45">Product Name <input id="productname" type="text"/></td>
                    <td class="W10"></td>
                </tr>
                <tr>
                    <td class="W45">Basic Raw Material <input id="basicraw" type="text"/></td>
                    <td class="W45">Group Name <input id="groupname" type="text"/></td>
                    <td class="W10">
                        <div class="btn-group">
                            <button class="btn btn-info btn-sm" id="groupcreate" onclick="group_Create()">C</button>
                            <button class="btn btn-info btn-sm" id="groupedit" onclick="group_Edit()">E</button>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="W40">Raw Material <input id="rm1" type="text"/></td>
                    <td class="W30">Size <input id="s1" type="text"/></td>
                    <td class="W20">Qty. <input id="q1" type="text"/></td>
                    <td class="W10">
                        <div class="btn-group">
                            <button class="btn btn-info btn-sm" onclick="maprawNsize()">C</button>
                            <button class="btn btn-info btn-sm" onclick="maprawNsize_Edit()">E</button>
                            <button class="btn btn-info btn-sm" id="pma" onclick="add_Row()">A</button>
                        </div>
                    </td>
                </tr>                    
                <tr>
                    <td class="W45">VAT Rate <input id="vat" type="text"/></td>
                    <td class="W45">Unit Of Measure <input id="uom" type="text"/></td>
                    <td class="W10"></td>
                </tr>
                <tr>
                    <td class="W45">Manufacturing Cost <input id="menucost" type="text"/></td>
                    <td class="W45">Sale Rate <input id="salerate" type="text"/></td>
                    <td class="W10"></td>
                </tr>
                <tr>
                    <td class="W45">Maximum Retail Price <input id="mrp" type="text"/></td>
                    <td class="W45">Default Discount <input id="defdisc" type="text"/></td>
                    <td class="W10"></td>
                </tr>
                <tr>
                    <td class="W45">Rate List Date <input id="listdate" type="text"/></td>
                    <td class="W45">Kit Reference <input id="kitref" type="text"/></td>
                    <td class="W10"></td>
                </tr>
            </table>
        </form>
    </div>
    </body>
    </html>

JavaScript File ProductMaster.js

var rowCount = 1;
var rowPosition = 3;
var id = 2;
function add_Row() {
if (rowCount < 11) {
    var table = document.getElementById("productmasterTable");
    var row = table.insertRow(rowPosition);
    rowPosition++;
    for (i = 0; i < 1; i++) {
        var td1 = document.createElement("td");
        td1.innerHTML = 'Raw Material <input id="rm' + id + '" type="text"/>';
        row.appendChild(td1);
        td1.setAttribute("class", "W40");
    }
    for (i = 0; i < 1; i++) {
        var td2 = document.createElement("td");
        td2.innerHTML = 'Size <input id="s' + id + '" type="text"/>';
        row.appendChild(td2);
        td2.setAttribute("class", "W30");
    }
    for (i = 0; i < 1; i++) {
        var td3 = document.createElement("td");
        td3.innerHTML = 'Qty. <input id="q' + id + '" type="text"/>';
        row.appendChild(td3);
        td3.setAttribute("class", "W20");
    }
    id++;
    rowCount++;
}
else {
    alert("Only 10 Allowed");
}
}

JavaScript File RawMaterialGroup.js

function group_Create(){
document.getElementById('rawgroup').style.display = "block";
}

function group_Hide(){
document.getElementById('rawgroup').style.display = "none";
}

function group_Edit(){
alert("I Am Clicked");
}
var rowCount = 5;
var rowPosition = 7;
var id = 2;
function add_rawMaterial() {
if (rowCount < 16) {
    var table = document.getElementById("groupTable");
    var row = table.insertRow(rowPosition);
    rowPosition++;
    for (i = 0; i < 1; i++) {
        var td1 = document.createElement("td");
        td1.innerHTML = 'Raw Material <input id="rmgrm' + id + '" type="text"/>';
        row.appendChild(td1);
        td1.setAttribute("class", "W40");
    }
    for (i = 0; i < 1; i++) {
        var td2 = document.createElement("td");
        td2.innerHTML = 'Qty. <input id="rmgq' + id + '" type="text"/>';
        row.appendChild(td2);
        td2.setAttribute("class", "W20");
    }
    for (i = 0; i < 1; i++) {
        var td3 = document.createElement("td");
        td3.innerHTML = 'UOM <input id="rmguom' + id + '" type="text"/>';
        row.appendChild(td3);
        td3.setAttribute("class", "W20");
    }
    id++;
rowCount++;
}
else {
    alert("Only 15 Allowed");
}
}

CSS File ProductMaster.css

body{
text-align: center;
overflow: hidden;
}
td{
float: left;
text-align: left
}
#rm1,#rm2,#rm3,#rm4,#rm5,#rm6,#rm7,#rm8,#rm9,#rm10{
width: 250px;
height: 30px
}
#s1,#s2,#s3,#s4,#s5,#s6,#s7,#s8,#s9,#s10{
width: 250px;
height: 30px;
}
#q1,#q2,#q3,#q4,#q5,#q6,#q7,#q8,#q9,#q10{
width: 100px;
height: 30px;
}
.W45{
width: 45%;
}
.W10{
width: 10%;
}
.W15{
width: 15%;
}
.W20{
width: 20%;
}
.W30{
width: 30%;
}
#productid{
width: 100px;
height: 30px;
}
#productname{
width: 300px;
height: 30px;
}
#basicraw{
width: 259px;
height: 30px;
}
#groupname{
width: 315px;
height: 30px;
}
#productmasterForm{
font-size: 20px;
font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
}
#vat{
width: 80px;
height: 30px;
}
#uom{
width: 80px;
height: 30px;
}
#menucost{
width: 80px;
height: 30px;
}
#salerate{
width: 80px;
height: 30px;
}
#mrp{
width: 80px;
height: 30px;
}
#defdisc{
width: 80px;
height: 30px;
}
#listdate{
width: 120px;
height: 30px;
}
#kitref{
width: 100px;
height: 30px;
}

CSS File RawMaterialGroup.css

h2 {
background-color:#00a2e2;
padding:20px 20px;
margin:-10px -10px;
text-align:center;
border-radius:10px 10px 0 0;
border: 1px solid #313131;
}
#rawgroup{
width: 100%;
height: 100%;
opacity: 0.95;
top: 0;
bottom: 0;
display: none;
position: fixed;
background-color: #313131;
overflow: hidden;
alignment-adjust: central;
}
div#groupPopup{
position: fixed;
left: 18%;
top: 17%;
font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
}
img#close_group{
position: absolute;
right: -7px;
top: -7px;
cursor: pointer;
}
#groupForm{
max-width: 900px;
min-width: 900px;
padding: 10px 10px;
border: 2px solid gray;
border-radius: 10px;
font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
background-color: #fff;
margin:-10px -11px;
text-align:center;
border-radius:10px 10px 10px 10px;
}
.W40{
width: 40%;
}
.W20{
width: 20%;
}
.W10{
width: 10%;
}
#rmgrm1,#rmgrm2,#rmgrm3,#rmgrm4,#rmgrm5,#rmgrm6,#rmgrm7,#rmgrm8,#rmgrm9,#rmgrm10,#rmgrm11,#rmgrm12,#rmgrm13,#rmgrm14,#rmgrm15{
width: 215px;
height: 30px;
}
#rmgq1,#rmgq2,#rmgq3,#rmgq4,#rmgq5,#rmgq6,#rmgq7,#rmgq8,#rmgq9,#rmgq10,#rmgq11,#rmgq12,#rmgq13,#rmgq14,#rmgq15{
width: 80px;
height: 30px;
}
#rmguom1,#rmguom2,#rmguom3,#rmguom4,#rmguom5,#rmguom6,#rmguom7,#rmguom8,#rmguom9,#rmguom10,#rmguom11,#rmguom12,#rmguom13,#rmguom14,#rmguom15{
width: 50px;
height: 30px;
}
#rmggn{
width: 200px;
height: 30px;
}
#rmggi{
width: 100px;
height: 30px;
}



via Chebli Mohamed

Why is my input tag losing focus immediately after getting it?

By the design, menu container onblur event should be disabled when input gets focus and it should be enabled back when input loses focus (i.e. when user finishes input.

function pauseHiding(hiderId) {
    var hider = document.getElementById(hiderId);
    hider.onblur = null;
}

function resumeHiding(hiderId, timeout) {
    var hider = document.getElementById(hiderId);
    hider.onblur = "setTimeout(function(){hideMenu(hiderId);}, timeout);";
    hider.focus();
}

In fact, input's onfocus event fires normally, but it is followed immediately by onblur event. Moreover, onfocus erases menu container's onblur event, but input's onblur doesn't returns it back. http://ift.tt/1ONfleU



via Chebli Mohamed

How to convert "UCS-2" to "UTF-8" by this way, with HTML, in PHP?

I have a HTML form, which is set in ISO-8859-1. Now, I want to convert UCS-2 string into UTF-8 string; this output UTF-8 will print into <input type="text" name="out" />. And, my HTML form must not be changed the character set.

I have read these questions:

I try to solve my problem by this code:

<?php $str = $_POST['str']; ?>
<form method="post">
<input type="text" name="str" value="<?php echo $str; ?>" />
&nbsp;&nbsp;<input type="submit" />
</form>
<hr /><input type="text" name="out" value="<?php echo mb_convert_encoding($str, 'UCS-2', 'UTF-8'); ?>" />

When I input a word in UCS-2, such as: Việt Nam, it will returns: �V�i�&�#�7�8�7�9�;�t� �N�a�m. Why?

Is there any way to convert UCS-2 to UTF-8, by PHP; then, output into <input type="text" name="out" />?



via Chebli Mohamed

How to add elements from a JSON array to a grid using Angular.js

I have a JSON array in a file data.json which is as :

var info = [{
"place": "Turkey",
"username": "jhon"
}, {
"place": "Dubai",
"username": "bruce"
}, {
"place": "Italy",
"username": "Wayne"
}];

I am able to access these using a loop and check with the help of an alert box.. However, I wish to display the contents in the form of a table. I could use JavaScript or as somebody suggested to me I could also use Angular.js. Any idea on what way I could get along with will be easier?



via Chebli Mohamed

absolutely positioned div inside relatively positionsed div is not moving [on hold]

On my website I have 2 col-xs-6 inside a row. Both columns have an image in each and I want to add text over the top that will move when they do due to img-responsive, however the text doesn't seem to sit in the div but instead on top of it, heres a snip of the code http://ift.tt/1ONfhM4

Edit: this is not my website but a small snippet of it hence the single col-xs-6

Edit 2: I want my text to stay centered on top of the image when the image is resized, see http://ift.tt/18JzrDB for a working example, when the browser is resized the images resize as well as the image stays centered on the image and moves with it, this is what I want to achieve.



via Chebli Mohamed

Setting a variable in parent div and using it in children in angular

I'm new to AngularJS. I'm developing a page with a couple of similar blocks but I don't really want to use ng-repeat for those. The thing is, in their ng-click, ng-class and other directives I need to use some variable identifying the block. Is there a way to set it once in parent div and then use in children? Something like this:

<div ng-var="Potatoes">
    <button ng-click="buy($parent.var)">Buy</button>
    <span>This is a {{$parent.var}}</span>
    <img ng-class="{{$parent.var}}">
</div>

<div ng-var="Tomatoes">
    <button ng-click="buy($parent.var)">Buy</button>
    <span>This is a {{$parent.var}}</span>
    <img ng-class="{{$parent.var}}">
</div>

I would use ng-repeat over a specifically crafted object but in this case I have to manually position some other things that I omitted in the code above so ng-repeat is not an option, unfortunately.



via Chebli Mohamed

jquery dialog popup scroll issue in chrome

I am experiencing an issue with Jquery dialog popup .

Whenever I scroll down the content in dialog and close it, the focus is not getting automatically returned to the element that had focus when the dialog was opened. After the occurrence whenever I open a pop up, I have to manually scroll to view the pop up.

I am seeing this issue only in chrome.

Do we have any workaround for this issue ?

$(document).ready(function () {
$(document).on("click",function(){
    $("iframe-id").attr('src', $(this).attr("href"));
 $("div-id").dialog({
       width: 'auto',
        height: 'auto',
        modal: true,
            position:({
      my: "center",
      at: "center",
      of: "link id",
      collision:"none"
    })
 });        
return false;        
});

});

I have enclosed an iframe within a div and will be populating the iframe by an url content. I am using jquery v1.11.3.js and jquery 1.10.1 css



via Chebli Mohamed

Render some tags to jade template

at my backend I have such object which I am rendering:

  objectToRender =
    url: getUrl
    pid: pid
    meta: ['<meta name="one" code="272387238">', '<meta name="two" code="272387238">']
    urlEncoded: encodeGetUrl

  res.render 'index.jade', {objectToRender}

I need to take all meta tags and pass them to index.jade:

each val in #{objectToRender.meta}
   meta = val

But everything is crashing down

What can I do here?

my error is :

SyntaxError: /opt/rrr/yyyy/views/index.jade:7 5|
link(rel='stylesheet', type='text/css', href='build/css/app.css')
6| script(src='build/js/plugin_manager.js')

7| each val in #{objectToRender.meta} 8| meta = !{val} 9| body 10| strong#pid product id received:

{objectToRender.pid}

Unexpected token ILLEGAL at Function (:null:null)



via Chebli Mohamed

Set CSS class for several ID

I have done the following:

#my-el .some-class {
    width: 10%;
}

That works but now I'd like to apply the same class to the element #my-new-el. I've tried:

#my-el #my-new-el .some-class {
    width: 10%;
}

But this does not work. What would be the correct syntax to achieve this ?



via Chebli Mohamed

How to not enable toggle class at first?

$(document).ready(function(){
  $("#summary").click(function(){
    $(this).toggleClass('clicked');
  });
});
.clicked {
  background-color: red;
}
<script src="http://ift.tt/1g1yFpr"></script>
        
<div id="summary">
  <div class="clicked">111</div>
  <div class="clicked">222</div>
</div>

How to not set beckoned-color to red when html page load.Only change it to red when click on its div?



via Chebli Mohamed

Fade in images after loading with preloader icon?

I have thumbnail grid build and i would like to achieve a fade in of the images after they have been loaded with a image placeholder and preloader on top. I have a example from a website that uses the same principal of loading the images:

--> See website example

--> Here my Fiddle

This is my thumbnail grid stucture:

<div class="grid-wrapper">

    <div class="grid-group compact-group">

        <div class="grid-item size-xs compact-item">
            <a href="#">
                <img src="http://ift.tt/1IJLvb0">
                <div class="caption">Project untitled</div>
            </a>
        </div>

        <div class="grid-item size-xs compact-item">
            <a href="#">
                <img src="http://ift.tt/1IDDFLB">
                <div class="caption">Project untitled</div>
            </a>
        </div>

        <div class="grid-item size-xs compact-item">
            <a href="#">
                <img src="http://ift.tt/1IJLtzK">
                <div class="caption">Project untitled</div>
            </a>
        </div>

        <div class="grid-item size-xs compact-item">
            <a href="#">
                <img src="http://ift.tt/1IJLtzM">
                <div class="caption">Project untitled</div>
            </a>
        </div>

    </div>
    <!-- grid-group -->
</div>
<!-- grid-wrapper -->



via Chebli Mohamed

Remove empty tags from html String in Swift

I am trying to remove empty <p></p> tags from my string whose content is html. I have tried to use regex such as;

let deleteRegex = NSRegularExpression(pattern: "<p[^>]*><\\/p[^>]*>", options: NSRegularExpressionOptions.allZeros, error: nil)
deleteRegex?.stringByReplacingMatchesInString(comment.text!, options: NSMatchingOptions.allZeros, range: NSMakeRange(0, (comment.text! as NSString).length), withTemplate: "")

However i got no success. Any help would be appreciated.



via Chebli Mohamed

Twitter bootstrap not working properly in safari 5.1.7

Am using below Twitter Bootstrap cnd it is working well with Firefox ,chrome and IE browsers but problem with Safari 5.1.7 browser as well as Iphone 6.

<link rel="stylesheet" href="http://ift.tt/1K1B2rp">
<link rel="stylesheet" href="http://ift.tt/1QMqYrP">
<script src="http://ift.tt/1InYcE4"></script>

Also added

 <meta name="viewport" content="width=device-width, initial-scale=1">

But not working well in Safari Browser .

hope for the best.



via Chebli Mohamed

Triple inheritance

I have a main template that adds scripts, styles, etc - let's call it main.tpl file:

<!DOCTYPE>
<html>
 <head>
  ...
 </head>
 <body>
  {block name=body}{/block}
  <script src="..."></script>
 </body>
</html>

Then I have a file that adds a template to the website, let's call it template.tpl:

{extends file="template.tpl"}
{block name=body}
 <div class="container">
  <div class="template">
   <div class="menu">
    ...
   </div>
   {block name=body}{/block}
  </div>
 </div>
{/block}

And finally I have the file that I call from the controller, and want it to extend the other two:

{extends file="template.tpl"}
{block name=body}
 <div class="my-content">
  Hello world!
 </div>
{/block}

Ok, the problem is that the template.tpl is not attached to the website source. I mean, whatever I put inside template.tpl's body block, it won't matter, because it's never loaded.

How can I solve this?



via Chebli Mohamed

Checkbox doesn't work

I have a simple code with a javascript checkbox. You can see the frontend in this website:
englishforyou.ir
When you check the check box the total price should show the new figure but it doesn't.
All my code is in one page:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<body>
<div>
<div>    

 <?php
$title= "pen" ;
$penprice= 7 ;

?>
<form id="formpayment"  action="<?php echo  $urlname?>"  method="post"  > 
<p style="color:blue; font:11px">
 <input type="checkbox" id="check"  name="kol" />Please add the eraser (Add 5$)
 <br>
 </p>
  <table border="0" >
  <tr>
  <td><?php echo $title; ?>
  </td>
  <td ><input style="width: 60px; padding: 2px; border: 0px "  class="txt"  type="text" name="priceofpen" id="priceofpen" value="<?php echo $penprice ;?>   
  " readonly/>&nbsp$ 
  </td>
  <td>
  </td>
  </TR>
 <tr>
  <td><?php echo "Eraser price"; ?>   
  </td>
  <td  >  <input style="width: 50px; padding: 2px; border: 0px "  name="priceoferaser" class="txt" id="priceoferaser" value="0"  readonly="readonly" />  &nbsp; &nbsp;$
  </td>
  <td> 
  </td>
  </TR> 
  <tr>
  <td colspan="3"> <hr />    
  </td>
    </TR>
  <tr id="summation">
  <td>  Total:
  </td>
  <td>
  <input  style="width: 60px; padding: 2px; border: 0px " type=number name="total" id="total" value="<?php echo $penprice;?>"  readonly="readonly">$
  </td>
  <td>
  </td>
  </TR>
   </table>
    </p><br />
 </form>
  </div>
 </div>
 <script>
 $('#check').on('change',function(){
     var eraserprice = "5"

     var c=parseFloat(eraserprice)+ parseFloat(<?php echo $penprice;?>);
    if(this.checked)
     $('#total').val(    c     )&& $('#priceoferaser').val(   parseFloat(5000)    )  ) 

    else

        $('#total').val( <?php echo $penprice;?>)&& $('#priceoferaser').val(   parseFloat(0)    )

})
 </script>
</div>
</body>
</html>



via Chebli Mohamed