1. Roma Sokolov
  2. confs

Commits

Alexander Solovyov  committed 73ea13b

working buttons

  • Participants
  • Parent commits a09ead1
  • Branches default

Comments (0)

Files changed (3)

File piu/static/main.js

View file
  • Ignore whitespace
+$(document).ready(function() {
+    var lexers = $('#id-lexer');
+    $('span.hot').click(function() {
+        var lang = $(this).attr('rel');
+        $('#id-lexer [value=' + lang + ']').attr('selected', 1);
+        });
+    });

File piu/templates/base.tpl

View file
  • Ignore whitespace
   <title>paste.in.ua: {{ title }}</title>
   <link rel="stylesheet" href="/static/styles/default.css">
   <script src="/static/jquery-1.3.2.min.js"></script>
+  <script src="/static/main.js"></script>
 </head>
 <body>
   <header>

File piu/templates/index.tpl

View file
  • Ignore whitespace
       {%- endfor %}
     </select>
 
-    <span class="hot python">Python</span>
-    <span class="hot js">JavaScript</span>
-    <span class="hot ruby">Ruby</span>
-    <span class="hot css">CSS</span>
-    <span class="hot django">Django/Jinja</span>
+    <span class="hot" rel="python">Python</span>
+    <span class="hot" rel="js">JavaScript</span>
+    <span class="hot" rel="rb">Ruby</span>
+    <span class="hot" rel="css">CSS</span>
+    <span class="hot" rel="django">Django/Jinja</span>
   </div>
 
   <div><textarea name="data" rows="20" cols="120"></textarea></div>