Permalink
Browse files

NOJIRA Jshint cleanup

Squashed commit of the following:

commit cd109dfe204ff803adf1d9c0f2c547db6e9d835a
Merge: 58ae986 bb0b887
Author: Chris Roby <christopher.roby@gmail.com>
Date:   Fri Dec 16 11:57:57 2011 -0800

    Merge remote-tracking branch 'christianv/jshint-cleanup' into christianv-jshint-cleanup

commit bb0b887
Author: Christian Vuerings <vueringschristian@gmail.com>
Date:   Fri Dec 16 11:53:54 2011 -0800

    NOJIRA - Fix JSHint errors - update 2 of #1498

commit a16241a
Author: Christian Vuerings <vueringschristian@gmail.com>
Date:   Fri Dec 16 11:41:02 2011 -0800

    NOJIRA - Fix the issues on the previous pull request https://github.com/sakaiproject/3akai-ux/pull/1498/files

commit b6c7b8e
Author: Christian Vuerings <vueringschristian@gmail.com>
Date:   Thu Dec 15 16:56:58 2011 -0800

    NOJIRA: Remove duplicate line

commit 14e0211
Merge: 523c4a9 074a54c
Author: Christian Vuerings <vueringschristian@gmail.com>
Date:   Thu Dec 15 16:30:31 2011 -0800

    NOJIRA - merge in v1.1.1 + fix a merge conflict in versions.js

commit 523c4a9
Merge: 5029b3e 752b1e9
Author: Christian Vuerings <vueringschristian@gmail.com>
Date:   Thu Dec 15 16:15:46 2011 -0800

    NOJIRA - Merge stuartf/jshint-cleanup + add some extra fixes to new files

commit 752b1e9
Author: D. Stuart Freeman <stuart.freeman@et.gatech.edu>
Date:   Fri Dec 2 10:23:11 2011 -0500

    NOJIRA clean up jshint errors
  • Loading branch information...
1 parent 58ae986 commit 77a0c30e518ff112ba90516ca3c6da9e1a2f3e34 @christianvuerings christianvuerings committed with croby Dec 16, 2011
Showing with 109 additions and 110 deletions.
  1. +13 −13 dev/javascript/acknowledgements.js
  2. +1 −1 dev/javascript/sakai.403.js
  3. +1 −1 dev/javascript/sakai.404.js
  4. +3 −3 dev/javascript/search.js
  5. +0 −5 dev/javascript/search_sakai2.js
  6. +2 −2 dev/javascript/search_util.js
  7. +1 −1 dev/lib/sakai/sakai.api.communication.js
  8. +1 −1 dev/lib/sakai/sakai.api.content.js
  9. +3 −3 dev/lib/sakai/sakai.api.groups.js
  10. +2 −2 dev/lib/sakai/sakai.api.server.js
  11. +2 −2 devwidgets/accountpreferences/javascript/accountpreferences.js
  12. +1 −0 devwidgets/addarea/javascript/addarea.js
  13. +10 −10 devwidgets/areapermissions/javascript/areapermissions.js
  14. +8 −4 devwidgets/collections/javascript/collections.js
  15. +3 −3 devwidgets/contacts/javascript/contacts.js
  16. +5 −5 devwidgets/contentpermissions/javascript/contentpermissions.js
  17. +5 −5 devwidgets/deletecontent/javascript/deletecontent.js
  18. +1 −1 devwidgets/embedcontent/javascript/embedcontent.js
  19. +2 −2 devwidgets/entity/javascript/entity.js
  20. +6 −6 devwidgets/lhnavigation/javascript/lhnavigation.js
  21. +1 −1 devwidgets/listpeopleinnode/javascript/listpeopleinnode.js
  22. +1 −1 devwidgets/mylibrary/javascript/mylibrary.js
  23. +4 −5 devwidgets/newaddcontent/javascript/newaddcontent.js
  24. +4 −4 devwidgets/pageviewer/javascript/pageviewer.js
  25. +1 −1 devwidgets/relatedcontent/javascript/relatedcontent.js
  26. +3 −2 devwidgets/sakai2tools/javascript/sakai2tools.js
  27. +1 −1 devwidgets/savecontent/javascript/savecontent.js
  28. +5 −4 devwidgets/searchsakai2/javascript/searchsakai2.js
  29. +16 −17 devwidgets/topnavigation/javascript/topnavigation.js
  30. +3 −3 devwidgets/versions/javascript/versions.js
  31. +0 −1 tests/qunit/js/dev.js
@@ -21,7 +21,7 @@ require(["jquery","sakai/sakai.api.core"], function($, sakai) {
sakai_global.acknowledgements = function() {
var pubdata = {
- "structure0": {
+ "structure0": {
"featured": {
"_ref": "id1",
"_title": "Featured",
@@ -53,24 +53,24 @@ require(["jquery","sakai/sakai.api.core"], function($, sakai) {
}
}
},
- "id1": {
- "page": $("#acknowledgements_featured").html()
- },
- "id2": {
- "page": $("#acknowledgements_uitech").html()
- },
- "id3": {
- "page": $("#acknowledgements_backendtech").html()
- }
- }
+ "id1": {
+ "page": $("#acknowledgements_featured").html()
+ },
+ "id2": {
+ "page": $("#acknowledgements_uitech").html()
+ },
+ "id3": {
+ "page": $("#acknowledgements_backendtech").html()
+ }
+ };
var generateNav = function(){
$(window).trigger("lhnav.init", [pubdata, {}, {}]);
- }
+ };
var renderEntity = function(){
$(window).trigger("sakai.entity.init", ["acknowledgements"]);
- }
+ };
$(window).bind("lhnav.ready", function(){
generateNav();
@@ -60,7 +60,7 @@ require(["jquery","sakai/sakai.api.core"], function($, sakai) {
var world = sakai.config.worldTemplates[c];
world.label = sakai.api.i18n.getValueForKey(world.titlePlural);
if(c===sakai.config.worldTemplates.length-1){
- world.last = true;
+ world.last = true;
}
worlds.push(world);
}
@@ -61,7 +61,7 @@ require(["jquery","sakai/sakai.api.core"], function($, sakai) {
var world = sakai.config.worldTemplates[c];
world.label = sakai.api.i18n.getValueForKey(world.titlePlural);
if(c===sakai.config.worldTemplates.length-1){
- world.last = true;
+ world.last = true;
}
worlds.push(world);
}
View
@@ -79,14 +79,14 @@ require(["jquery","sakai/sakai.api.core"], function($, sakai) {
"_order": 0,
"_title": title
}
- }
+ };
var searchWidgetId = sakai.api.Util.generateWidgetId();
pubdata[refId] = {
"page": "<div id='widget_searchgroups_" + searchWidgetId + "' class='widget_inline'></div>"
- }
+ };
pubdata[searchWidgetId] = {
"category": category.id
- }
+ };
}
///////////////////
@@ -185,11 +185,6 @@ require(["jquery","sakai/sakai.api.core"], function($, sakai) {
*/
sakai_global._search.doSearch = function(page, searchquery, searchwhere, facet) {
- //alert(page);
- //alert(searchquery);
- //alert(searchwhere);
- //alert(facet);
-
// if there is facet selected then remove previous one and highlight new one
if (facet) {
$(".faceted_category").removeClass("faceted_category_selected");
@@ -54,8 +54,8 @@ require(["jquery","sakai/sakai.api.core"], function($, sakai) {
// Set search view //
/////////////////////
- if (config && config.tuid && view === "grid"
- && $(".s3d-search-results-container").length){
+ if (config && config.tuid && view === "grid" &&
+ $(".s3d-search-results-container").length){
$(".s3d-search-results-container").addClass("s3d-search-results-grid");
}
$(".search_view_" + view).addClass("selected");
@@ -316,7 +316,7 @@ define(
var path = message.path;
if (path.substring(0, 2) === "a:"){
path = "~" + path.substring(2);
- };
+ }
var req = {url: path + ".json", method: "POST", parameters: {"sakai:read": "true"}};
requests.push(req);
});
@@ -1273,7 +1273,7 @@ define(
// 3. Set the permissions on the pooled content item
sakai_content.setFilePermissions([{"hashpath": collectionId, "permissions": collectionObject["sakai:permissions"]}], function(){
- // 4. Create the pseudoGroups
+ // 4. Create the pseudoGroups
var groupId = sakai_content.Collections.getCollectionGroupId(collectionId);
var batchRequests = [];
var membershipsToProcess = [];
@@ -104,7 +104,7 @@ define(
});
if ($.isFunction(callback)){
callback(true, toReturn);
- };
+ }
});
},
@@ -903,7 +903,7 @@ define(
urlToGroupMapping[url] = {
"groupid": groupid,
"role": roles[i].id
- }
+ };
batchRequests.push({
"url": url,
"method": "GET",
@@ -925,7 +925,7 @@ define(
dataToReturn[groupid][roleid] = {"results": members};
if (sakaiGroupsAPI.groupData[groupid]){
sakaiGroupsAPI.groupData[groupid].membersPerRole = sakaiGroupsAPI.groupData[groupid].membersPerRole || {};
- sakaiGroupsAPI.groupData[groupid].membersPerRole[roleid] = {"results": members}
+ sakaiGroupsAPI.groupData[groupid].membersPerRole[roleid] = {"results": members};
}
});
if ($.isFunction(callback)) {
@@ -170,8 +170,8 @@ define(
sakaiServerAPI.initialRequests[bundleId].callback = callback;
}
sakaiServerAPI.initialRequests[bundleId].count++;
- if (numRequests === sakaiServerAPI.initialRequests[bundleId].count
- && $.isFunction(sakaiServerAPI.initialRequests[bundleId].callback)) {
+ if (numRequests === sakaiServerAPI.initialRequests[bundleId].count &&
+ $.isFunction(sakaiServerAPI.initialRequests[bundleId].callback)) {
sakaiServerAPI.batch(sakaiServerAPI.initialRequests[bundleId].requests, function(success, data) {
if (success) {
var jsonData = {
@@ -468,13 +468,13 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
selectAutoTagging($(this).attr("data-sakai-autotagging") === "true" ? true : false);
enableElements($(saveRegional));
e.preventDefault();
- })
+ });
var hideAllPanes = function(){
$(passChangeContainer).hide();
$(preferContainer).hide();
$(privacyContainer).hide();
- }
+ };
$(accountPreferencesPreferencesTab).click(function(){
$(accountPreferencesTabsButtons).removeClass(tabSelected);
@@ -772,6 +772,7 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai){
if (!query) {
url = "/var/search/pool/all-all.0.json";
}
+
if (library) {
json["userid"] = sakai.data.me.user.userid;
url = "/var/search/pool/manager-viewer.json";
@@ -105,7 +105,7 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
"area": currentArea._title,
"meRole": data.id
}));
- })
+ });
};
var checkSelectedPermissionForRole = function(roleId){
@@ -154,7 +154,7 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
} else if (rolePermission === "view"){
newView.push("-" + roles[i].id);
}
- };
+ }
// Refetch docstructure information
$.ajax({
@@ -195,9 +195,9 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
});
// Per role visibility
- for (var i = 0; i < roles.length; i++) {
- var role = sakai_global.group.groupId + "-" + roles[i].id;
- var selectedPermission = checkSelectedPermissionForRole(roles[i].id);
+ for (var j = 0; j < roles.length; j++) {
+ var role = sakai_global.group.groupId + "-" + roles[j].id;
+ var selectedPermission = checkSelectedPermissionForRole(roles[j].id);
var parameters = {
":viewer@Delete": role,
":manager@Delete": role
@@ -211,23 +211,23 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
parameters = {
":viewer@Delete": role,
":manager": role
- }
+ };
aclParameters = {
"principalId": role,
"privilege@jcr:write": "granted",
"privilege@jcr:read": "granted"
- }
+ };
} else if (selectedPermission === "view"){
parameters = {
":viewer": role,
":manager@Delete": role
- }
+ };
aclParameters = {
"principalId": role,
"privilege@jcr:write": "denied",
"privilege@jcr:read": "granted"
- }
- };
+ };
+ }
permissionsBatch.push({
"url": contextData.pageSavePath + ".members.json",
"method": "POST",
@@ -137,7 +137,7 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
} else {
$(collectionsNoCollections).show();
}
- }
+ };
var carouselBinding = function(carousel){
$("#collections_scroll_right").unbind("click");
@@ -164,6 +164,10 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
}
};
+ var focusCollectionTitle = function(){
+ $('#collection_title_0').focus();
+ };
+
var createNewCollection = function(){
$("#collections_collection_title").attr("disabled", "disabled");
sakai.api.Util.progressIndicator.showProgressIndicator(sakai.api.i18n.getValueForKey("CREATING_YOUR_COLLECTION", "collections"), sakai.api.i18n.getValueForKey("WONT_BE_LONG", "collections"));
@@ -176,7 +180,7 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
$("#collections_collection_title").val("");
$("#collections_collection_title").removeAttr("disabled");
sakai.api.Util.notification.show(sakai.api.i18n.getValueForKey("COLLECTION_CREATED"), sakai.api.i18n.getValueForKey("COLLECTION_CREATED_LONG"));
- var t = setTimeout("$('#collection_title_0').focus()", 1000);
+ var t = setTimeout(focusCollectionTitle, 1000);
});
};
@@ -211,7 +215,7 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
$("ul[data-sakai-collection-id='" + collectionIds[i] + "']").html(sakai.api.Util.TemplateRenderer("collections_collections_recentcontent_template", contentItems));
});
});
- }
+ };
/////////////////////////////////////////
// DRAG AND DROP ITEMS IN FROM DESKTOP //
@@ -355,7 +359,7 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
var recentContentToLoad = [];
for (var i = 0; i < data.results.length; i = i + 4){
recentContentToLoad.push(data.results[i]["_path"]);
- };
+ }
getRecentContent(recentContentToLoad);
}, cache);
};
@@ -46,8 +46,8 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai){
var contactsAcceptedEmptyTemplate = "contacts_accepted_empty_template";
var contactsInvitedTemplate = "contacts_invited_template";
var contactsInvitedContainer = "#contacts_invited_container";
- var contactsShowGrid = ".s3d-listview-grid"
- var contactsShowList = ".s3d-listview-list"
+ var contactsShowGrid = ".s3d-listview-grid";
+ var contactsShowList = ".s3d-listview-list";
var contacts = { // global data for contacts widget
totalItems: 0,
sortBy: "lastName",
@@ -377,7 +377,7 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai){
contacts.query = q;
$.bbq.pushState({"cq": q});
}
- })
+ });
};
var doInit = function(){
@@ -47,7 +47,7 @@ require(["jquery", "sakai/sakai.api.core", "/dev/javascript/content_profile.js"]
// CONFIGURATION VARIABLES //
/////////////////////////////
- var contentpermissionsSelectable = ".contentpermissions_selectable > input"
+ var contentpermissionsSelectable = ".contentpermissions_selectable > input";
var contentData = sakai_global.content_profile.content_data;
var contentPermissionsEditList = "li.contentpermissions_edit";
var contentpermissionsMemberPermissions = ".contentpermissions_member_permissions";
@@ -198,7 +198,7 @@ require(["jquery", "sakai/sakai.api.core", "/dev/javascript/content_profile.js"]
type: "POST",
data: dataObj,
success: function(){
- sakai_global.content_profile.content_data.data["sakai:permissions"] = newPermissions
+ sakai_global.content_profile.content_data.data["sakai:permissions"] = newPermissions;
saveMemberPermissions();
}
});
@@ -413,8 +413,8 @@ require(["jquery", "sakai/sakai.api.core", "/dev/javascript/content_profile.js"]
});
$(".contentpermissions_permissions_container .s3d-actions-delete").live("click", doDelete);
- $("#contentpermissions_apply_permissions").live("click", showWarning);
- $("#contentpermissions_members_autosuggest_sharebutton").live("click", doShare)
+ $("#contentpermissions_apply_permissions").live("click", doSave);
+ $("#contentpermissions_members_autosuggest_sharebutton").live("click", doShare);
};
/**
@@ -467,4 +467,4 @@ require(["jquery", "sakai/sakai.api.core", "/dev/javascript/content_profile.js"]
};
sakai.api.Widgets.widgetLoader.informOnLoad("contentpermissions");
-});
+});
@@ -201,8 +201,8 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
var managers = contentIManage[m]["sakai:pooled-content-manager"];
if (managers){
for (var i = 0; i < managers.length; i++){
- if ($.inArray(managers[i], userGroupIds) === -1 && managers[i] !== sakai.data.me.user.userid
- && managers[i] !== context){
+ if ($.inArray(managers[i], userGroupIds) === -1 && managers[i] !== sakai.data.me.user.userid &&
+ managers[i] !== context){
userGroupIds.push(managers[i]);
}
}
@@ -227,16 +227,16 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
"parameters": {
items: 10000
}
- })
+ });
});
sakai.api.Server.batch(batchRequest, function (success, data) {
for (var i = 0; i < data.results.length; i++) {
if (data.results.hasOwnProperty(i)) {
var members = $.parseJSON(data.results[i].body);
for (var ii = 0; ii < members.length; ii++){
var member = members[ii].userid;
- if ($.inArray(member, userGroupIds) === -1 && member !== sakai.data.me.user.userid
- && member !== context){
+ if ($.inArray(member, userGroupIds) === -1 && member !== sakai.data.me.user.userid &&
+ member !== context){
userGroupIds.push(member);
}
}
@@ -578,7 +578,7 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
return false;
});
- $(window).unbind("finished.pickeradvanced.sakai");
+ $(window).unbind("finished.pickeradvanced.sakai");
$(window).bind("finished.pickeradvanced.sakai", function(e, data) {
addChoicesFromPickeradvanced(data.toAdd);
});
@@ -497,9 +497,9 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
$(window).bind("sakai.entity.updatecountcache", function(e, data){
if(data.increment){
- $("#entity_comments_link > span").text(parseInt($("#entity_comments_link > span").text()) + 1);
+ $("#entity_comments_link > span").text(parseInt($("#entity_comments_link > span").text(), 10) + 1);
} else{
- $("#entity_comments_link > span").text(parseInt($("#entity_comments_link > span").text()) - 1);
+ $("#entity_comments_link > span").text(parseInt($("#entity_comments_link > span").text(), 10) - 1);
}
});
Oops, something went wrong.

0 comments on commit 77a0c30

Please sign in to comment.