update changelog
[phorkie.git] / www / phorkie.js
index 20066c4f8c0917b844fff2b613e68010a7ed02d3..1171b1acc8b1cbc23c101abba7e2ff3093a87515 100644 (file)
@@ -9,6 +9,13 @@ function filenameChange(elem, id) {
         $('#typetext_' + id).hide();
     }
 }
+
+function initEdit()
+{
+    initFilenames();
+    initAdditionals();
+    $('.filegroup:visible:last textarea').focus();
+}
 function initFilenames()
 {
     $('input.filename').each(
@@ -24,3 +31,23 @@ function initFilenames()
         }
     );
 }
+function initAdditionals()
+{
+    $('a.additional-btn').each(
+        function(num, elem) {
+            toggleAdditional(elem, 0);
+            $(elem).show();
+        }
+    );
+}
+
+function toggleAdditional(elem, time)
+{
+    if (undefined == time) {
+        time = 'fast';
+    }
+    var jt = jQuery(elem);
+    jt.children('i').toggleClass('icon-chevron-down')
+        .toggleClass('icon-chevron-up');
+    jt.parents('.row-fluid').children('.additional').toggle(time);
+}
\ No newline at end of file