|
@@ -5,10 +5,7 @@ $(document).ready(function() {
|
|
|
================================================= */
|
|
|
// Declare the currently loaded tags belonging to the user
|
|
|
var tags;
|
|
|
-
|
|
|
- // Fix to make the "X" in the Close button in dialogs show up
|
|
|
- $.fn.bootstrapBtn = $.fn.button.noConflict();
|
|
|
-
|
|
|
+
|
|
|
// This piece of code is for making the column-count and column-gap CSS to work in Firefox
|
|
|
document.getElementById("7-5-col-layout").style.MozColumnCount = "5";
|
|
|
document.getElementById("4-col-layout").style.MozColumnCount = "4";
|
|
@@ -20,7 +17,7 @@ $(document).ready(function() {
|
|
|
return false;
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
/* ================================================
|
|
|
Rearrange fields numerically if 1 column is displayed
|
|
|
================================================= */
|
|
@@ -163,7 +160,7 @@ $(document).ready(function() {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- // When the user clicks on "Jump to", show menu
|
|
|
+ // If the user clicks on "Jump to", show menu
|
|
|
$("div.jump-to-click-area").on("click", function() {
|
|
|
// Toggle the menu
|
|
|
$("div.jump-to div div").slideToggle(300);
|
|
@@ -177,7 +174,7 @@ $(document).ready(function() {
|
|
|
return false;
|
|
|
});
|
|
|
|
|
|
- // When the user clicks on a menu item
|
|
|
+ // If the user clicks on a menu item
|
|
|
$("div.jump-to ul a").on("click", function() {
|
|
|
// Declarations
|
|
|
var chosenLiIndex = $(this).parent().index();
|
|
@@ -633,13 +630,13 @@ $(document).ready(function() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // When the user presses a key in the description textarea
|
|
|
+ // If the user presses a key in the description textarea
|
|
|
$("div#tag-window textarea#tag-description").on("keyup", function() {
|
|
|
// Update remaining characters
|
|
|
updateRemainingCharacters();
|
|
|
});
|
|
|
|
|
|
- // When the user clicks on the "Save tag" button
|
|
|
+ // If the user clicks on the "Save tag" button
|
|
|
$("div#tag-window #save-tag").on("click", function() {
|
|
|
// Declarations
|
|
|
var description = $("div#tag-window textarea#tag-description").val();
|
|
@@ -676,13 +673,13 @@ $(document).ready(function() {
|
|
|
tagIsNew = false;
|
|
|
});
|
|
|
|
|
|
- // When the user clicks on the "Close" button
|
|
|
+ // If the user clicks on the "Close" button
|
|
|
$("div#tag-window button.close").on("click", function() {
|
|
|
// Close the tag window
|
|
|
closeTagWindow();
|
|
|
});
|
|
|
|
|
|
- // When the user clicks on the "Delete tag" button
|
|
|
+ // If the user clicks on the "Delete tag" button
|
|
|
$("div#tag-window #delete-tag").on("click", function() {
|
|
|
// Declarations
|
|
|
var tagToAJAX = tag;
|
|
@@ -713,7 +710,7 @@ $(document).ready(function() {
|
|
|
closeTagWindow();
|
|
|
});
|
|
|
|
|
|
- // When the user focuses in the textarea
|
|
|
+ // If the user focuses in the textarea
|
|
|
$("div#tag-window textarea#tag-description").on("focusin", function() {
|
|
|
// Declarations
|
|
|
var description = $("div#tag-window textarea#tag-description").val();
|
|
@@ -726,7 +723,7 @@ $(document).ready(function() {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- // When the user focuses out the textarea
|
|
|
+ // If the user focuses out the textarea
|
|
|
$("div#tag-window textarea#tag-description").on("focusout", function() {
|
|
|
// Declarations
|
|
|
var description = $("div#tag-window textarea#tag-description").val();
|
|
@@ -740,14 +737,14 @@ $(document).ready(function() {
|
|
|
});
|
|
|
|
|
|
/* ================================================
|
|
|
- When the user types a new character in the added idea field, add tag if a term could be found
|
|
|
+ If the user types a new character in the added idea field, add tag if a term could be found
|
|
|
================================================= */
|
|
|
|
|
|
// 8an33j24
|
|
|
|
|
|
function applyTagOnTypeMatch() {
|
|
|
$("li.added_item div").on("focusin", function() {
|
|
|
- // When the user presses a key in the description textarea
|
|
|
+ // If the user presses a key in the description textarea
|
|
|
$("li.added_item div").on("keyup", function() {
|
|
|
if(event.which !== 9 && // Tab
|
|
|
event.which !== 16 && // Shift
|
|
@@ -870,13 +867,21 @@ $(document).ready(function() {
|
|
|
|
|
|
// if(length >= maxLength) {
|
|
|
// $(this).html(newText);
|
|
|
-
|
|
|
+
|
|
|
// Move the text cursor to the very end
|
|
|
}
|
|
|
});
|
|
|
*/
|
|
|
}
|
|
|
|
|
|
+ /* ================================================
|
|
|
+ If the user closes a dialog
|
|
|
+ ================================================= */
|
|
|
+ $("div.dialog button").on("click", function() {
|
|
|
+ $("div#shadow").css("display", "none");
|
|
|
+ $("div.dialog").css("display", "none");
|
|
|
+ });
|
|
|
+
|
|
|
/* ================================================
|
|
|
The user clicks on the "Tag selected term" link
|
|
|
================================================= */
|
|
@@ -897,7 +902,7 @@ $(document).ready(function() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // When the user clicks on the "Tag selected term" link
|
|
|
+ // If the user clicks on the "Tag selected term" link
|
|
|
$("p.tag-selected-term a").on("click", function() {
|
|
|
// If the tag isn't empty
|
|
|
if(tag != "") {
|
|
@@ -907,22 +912,14 @@ $(document).ready(function() {
|
|
|
else {
|
|
|
// Show a dialog
|
|
|
$("div#shadow").css("display", "block");
|
|
|
- $("#dialog-select-term").dialog({draggable: false, resizable: false});
|
|
|
-
|
|
|
- // Style the close button inside the dialog
|
|
|
- $(".ui-button-icon-only").html("<button type='button' class='close' aria-label='Close'><span aria-hidden='true'>×</span></button>");
|
|
|
+ $("div#dialog-select-term").css("display", "block");
|
|
|
}
|
|
|
|
|
|
// Prevent the current view to jump to the top of the screen
|
|
|
return false;
|
|
|
});
|
|
|
-
|
|
|
- // Hide the shadow when closing a dialog
|
|
|
- $(".dialog").on("dialogclose", function() {
|
|
|
- $("div#shadow").css("display", "none");
|
|
|
- });
|
|
|
-
|
|
|
- // When the user moves the focus from the added idea, reset variables
|
|
|
+
|
|
|
+ // If the user moves the focus from the added idea, reset variables
|
|
|
// $("li.added_item textarea").on("focusout", function() {
|
|
|
$("li.added_item div").on("focusout", function() {
|
|
|
selection = "";
|
|
@@ -930,9 +927,9 @@ $(document).ready(function() {
|
|
|
});
|
|
|
|
|
|
/* ================================================
|
|
|
- When the user clicks on a tag, show the tag window
|
|
|
+ If the user clicks on a tag, show the tag window
|
|
|
================================================= */
|
|
|
- // When the user clicks on a tag
|
|
|
+ // If the user clicks on a tag
|
|
|
function showTagWindowOnTagClick() {
|
|
|
$("a.tag").on("click", function() { // Event not triggered...
|
|
|
// Declarations
|
|
@@ -946,10 +943,7 @@ $(document).ready(function() {
|
|
|
else {
|
|
|
// Show a dialog
|
|
|
$("div#shadow").css("display", "block");
|
|
|
- $("#dialog-log-in").dialog({draggable: false, resizable: false});
|
|
|
-
|
|
|
- // Style the close button inside the dialog
|
|
|
- $(".ui-button-icon-only").html("<button type='button' class='close' aria-label='Close'><span aria-hidden='true'>×</span></button>");
|
|
|
+ $("div#dialog-log-in").css("display", "block");
|
|
|
}
|
|
|
});
|
|
|
}
|