Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1va zadaca
- <html>
- <head>
- <meta charset=UTF-8>
- <title>Zadaca1</title>
- <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css"/>
- <script src="http://code.jquery.com/jquery-1.8.3.js"></script>
- <script src="/resources/demos/external/jquery.bgiframe-2.1.2.js"></script>
- <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
- <style>
- body { font-size: 62.5%; }
- label, input { display:block; }
- input.text { margin-bottom:12px; width:95%; padding: .4em; }
- fieldset { padding:0; border:0; margin-top:25px; }
- h1 { font-size: 1.2em; margin: .6em 0; }
- div#users-contain { width: 350px; margin: 20px 0; }
- div#users-contain table { margin: 1em 0; border-collapse: collapse; width: 100%; }
- div#users-contain table td, div#users-contain table th { border: 1px solid #eee; padding: .6em 10px; text-align: left; }
- .ui-dialog .ui-state-error { padding: .3em; }
- .validateTips { border: 1px solid transparent; padding: 0.3em; }
- </style>
- <script type="text/javascript">
- $(function() {
- var id = $( "#sifra" ),
- ime = $( "#ime" ),
- proizvoditel = $( "#proizvoditel" ),
- allFields = $( [] ).add( id ).add( ime ).add( proizvoditel ),
- tips = $( ".validateTips" );
- function updateTips( t ) {
- tips
- .text( t )
- .addClass( "ui-state-highlight" );
- setTimeout(function() {
- tips.removeClass( "ui-state-highlight", 1500 );
- }, 500 );
- }
- function checkRegexp( o, regexp, n ) {
- if ( !( regexp.test( o.val() ) ) ) {
- o.addClass( "ui-state-error" );
- updateTips( n );
- return false;
- } else {
- return true;
- }
- }
- $( "#dialog-form" ).dialog({
- autoOpen: false,
- height: 300,
- width: 350,
- modal: true,
- buttons: {
- Додади: function() {
- var bValid = true;
- allFields.removeClass( "ui-state-error" );
- bValid = bValid && checkRegexp( id, /^([0-9])+$/i,"Шифрата треба да биде составена единствено од броеви." );
- if ( bValid ) {
- $( "#users tbody" ).append( "<tr>" +
- "<td>" + id.val() + "</td>" +
- "<td>" + ime.val() + "</td>" +
- "<td>" + proizvoditel.val() + "</td>" +
- "</tr>" );
- $( this ).dialog( "close" );
- }
- },
- "Откажи": function() {
- $( this ).dialog( "close" );
- }
- },
- close: function() {
- allFields.val( "" ).removeClass( "ui-state-error" );
- }
- });
- $( "#create-user" )
- .button()
- .click(function() {
- $( "#dialog-form" ).dialog( "open" );
- });
- });
- </script>
- </head>
- <div id="dialog-form" title="Create new user">
- <p class="validateTips">Сите полиња се задолжителни.</p>
- <form>
- <fieldset>
- <label for="sifra">Шифра</label>
- <input type="text" name="sifra" id="sifra" class="text ui-widget-content ui-corner-all" />
- <label for="ime">Име</label>
- <input type="text" name="ime" id="ime" value="" class="text ui-widget-content ui-corner-all" />
- <label for="proizvoditel">Производител</label>
- <input type="text" name="proizvoditel" id="proizvoditel" value="" class="text ui-widget-content ui-corner-all" />
- </fieldset>
- </form>
- </div>
- <div id="users-contain" class="ui-widget">
- <h1>Постоечки ставки:</h1>
- <table id="users" class="ui-widget ui-widget-content">
- <thead>
- <tr class="ui-widget-header ">
- <th>Шифра</th>
- <th>Име</th>
- <th>Производител</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>12331</td>
- <td>име1</td>
- <td>производител1</td>
- </tr>
- </tbody>
- </table>
- </div>
- <button id="create-user">Додади нова ставка</button>
- </html>
- 2ra zadaca
- <html>
- <head>
- <meta charset=UTF-8>
- <title>Zadaca2</title>
- <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css"/>
- <script src="http://code.jquery.com/jquery-1.8.3.js"></script>
- <script src="/resources/demos/external/jquery.bgiframe-2.1.2.js"></script>
- <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
- <style>
- body { font-size: 62.5%; }
- label, input { display:block; }
- input.text { margin-bottom:12px; width:95%; padding: .4em; }
- fieldset { padding:0; border:0; margin-top:25px; }
- h1 { font-size: 1.2em; margin: .6em 0; }
- div#users-contain { width: 350px; margin: 20px 0; }
- div#users-contain table { margin: 1em 0; border-collapse: collapse; width: 100%; }
- div#users-contain table td, div#users-contain table th { border: 1px solid #eee; padding: .6em 10px; text-align: left; }
- .ui-dialog .ui-state-error { padding: .3em; }
- .validateTips { border: 1px solid transparent; padding: 0.3em; }
- </style>
- <script type="text/javascript">
- $(function() {
- var id = $( "#sifra" ),
- ime = $( "#ime" ),
- proizvoditel = $( "#proizvoditel" ),
- datum = $( "#datum" ),
- allFields = $( [] ).add( id ).add( ime ).add( proizvoditel ).add(datum),
- tips = $( ".validateTips" );
- function updateTips( t ) {
- tips
- .text( t )
- .addClass( "ui-state-highlight" );
- setTimeout(function() {
- tips.removeClass( "ui-state-highlight", 1500 );
- }, 500 );
- }
- function checkRegexp( o, regexp, n ) {
- if ( !( regexp.test( o.val() ) ) ) {
- o.addClass( "ui-state-error" );
- updateTips( n );
- return false;
- } else {
- return true;
- }
- }
- $( "#dialog-form" ).dialog({
- autoOpen: false,
- height: 300,
- width: 350,
- modal: true,
- buttons: {
- Додади: function() {
- var bValid = true;
- allFields.removeClass( "ui-state-error" );
- bValid = bValid && checkRegexp( id, /^([0-9])+$/i,"Шифрата треба да биде составена единствено од броеви." );
- if ( bValid ) {
- $( "#users tbody" ).append( "<tr>" +
- "<td>" + id.val() + "</td>" +
- "<td>" + ime.val() + "</td>" +
- "<td>" + proizvoditel.val() + "</td>" +
- "<td>" + datum.val() + "</td>" +"</tr>" );
- $( this ).dialog( "close" );
- }
- },
- "Откажи": function() {
- $( this ).dialog( "close" );
- }
- },
- close: function() {
- allFields.val( "" ).removeClass( "ui-state-error" );
- }
- });
- $( "#create-user" )
- .button()
- .click(function() {
- $( "#dialog-form" ).dialog( "open" );
- });
- });
- $(function() {
- $( "#datum" ).datepicker();
- });
- </script>
- </head>
- <div id="dialog-form" title="Create new user">
- <p class="validateTips">Сите полиња се задолжителни.</p>
- <form>
- <fieldset>
- <label for="sifra">Шифра</label>
- <input type="text" name="sifra" id="sifra" class="text ui-widget-content ui-corner-all" />
- <label for="ime">Име</label>
- <input type="text" name="ime" id="ime" value="" class="text ui-widget-content ui-corner-all" />
- <label for="proizvoditel">Производител</label>
- <input type="text" name="proizvoditel" id="proizvoditel" value="" class="text ui-widget-content ui-corner-all" />
- <label for="datum">Датум</label>
- <input type="text" name="datum" id="datum" class="text ui-widget-content ui-corner-all" />
- </fieldset>
- </form>
- </div>
- <div id="users-contain" class="ui-widget">
- <h1>Постоечки ставки:</h1>
- <table id="users" class="ui-widget ui-widget-content">
- <thead>
- <tr class="ui-widget-header ">
- <th>Шифра</th>
- <th>Име</th>
- <th>Производител</th>
- <th>Датум</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>12331</td>
- <td>име1</td>
- <td>производител1</td>
- <td>Датум</td>
- </tr>
- </tbody>
- </table>
- </div>
- <button id="create-user">Додади нова ставка</button>
- </html>
- 4ta zadaca
- <html>
- <head>
- <meta charset="utf-8" />
- <title>Вежба 3 - sortables</title>
- <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css" />
- <script src="http://code.jquery.com/jquery-1.8.2.js"></script>
- <script src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script>
- <style>
- #sortable1 {
- margin: 10px;
- width: 73px;
- height: 73px;
- border: 1px solid black;
- padding: 1px;
- }
- #sortable2{
- margin: 10px;
- width:509px;
- height: 73px;
- border: 1px solid black;
- padding: 1px;
- position:relative;
- }
- #sortable2 li {
- float:left;
- }
- .ui-state-default {
- width: 70px;
- height: 70px;
- list-style-type: none;
- position: absolute;
- cursor:pointer;
- }
- </style>
- <script>
- $(function() {
- $("#sortable1, #sortable2").sortable({
- connectWith : ".connectedSortable"
- }).disableSelection();
- $("#sortable1, #sortable2").sortable().bind('sortstop', function() {
- $("#sortable1 li").css('position', 'absolute');
- $("#sortable2 li").css('position', 'relative');
- });
- });
- </script>
- </head>
- <body>
- <ul id="sortable1" class="connectedSortable">
- <li class="ui-state-default">
- Card 1
- </li>
- <li class="ui-state-default">
- Card 2
- </li>
- <li class="ui-state-default">
- Card 3
- </li>
- <li class="ui-state-default">
- Card 4
- </li>
- <li class="ui-state-default">
- Card 5
- </li>
- <li class="ui-state-default">
- Card 6
- </li>
- <li class="ui-state-default">
- Card 7
- </li>
- </ul>
- <ul id="sortable2" class="connectedSortable">
- </ul>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment