<commit_before>/*
 * Licensed to the Sakai Foundation (SF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The SF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 */

/*global $, Querystring, fluid, sakai */

/**
 * @name sakai.fileupload
 *
 * @class fileupload
 *
 * @description
 * Initialize the fileupload widget
 *
 * @version 0.0.1
 * @param {String} tuid Unique id of the widget
 * @param {Boolean} showSettings Show the settings of the widget or not
 */
sakai.fileupload = function(tuid, showSettings){


    /////////////////////////////
    // Configuration variables //
    /////////////////////////////

    var $rootel = $("#" + tuid);

    // All files that need to have been uploaded
    var uploadedFiles;
    var tags = [];

    var setDescriptionandName = false;
    var filesUploaded = false;
    var filesTagged = false;
    var tagsCreated = false;
    var setPermissions = false;

    var groupContext = false;
    var newVersion = false;
    var uploadedLink = false;
    var newVersionIsLink = false;
    var oldVersionPath = "";
    var context = "";

    // Classes
    var multiFileRemove = ".MultiFile-remove";
    var fileUploadProgress = "fileupload_upload_progress";
    var multiFileList = ".MultiFile-list";

    // ID
    var fileUploadAddDescription = "#fileupload_add_description";
    var multiFileUpload = "#multifile_upload";
    var newUploaderForm = "#new_uploader form";
    var fileUploadUploadContent = "#upload_content";
    var fileUploadAddTags = "#fileupload_add_tags";
    var fileUploadProgressId = "#fileupload_upload_progress";
    var fileUploadPermissionsSelect = "#fileupload_permissions_select";
    var fileUploadWidgetTitle= "#fileupload_widget_title";
    var fileUploadWidgetTitleNewVersion= "#fileupload_widget_title_new_version";
    var fileUploadAddVersionDescription = "#fileupload_add_version_description";

    var fileUploadLinkBoxInput= "#fileupload_link_box_input";
    var fileUploadLinkForm = "#link_form";
    var fileUploadAddLinkButton = "#fileupload_add_link_button";

    // Form
    var multiFileForm = "#multifile_form";
    var fileUploadSubmit = "#fileupload_submit";

    var cancelButton = "#fileupload_cancel";

    // Templates
    var fileUploadTaggingTemplate = "#fileupload_tagging_template";
    var fileUploadAddToTemplate = "#fileupload_add_to_template";
    var fileUploadNoLimitToUploadTemplate = "#fileupload_no_limit_to_upload_template";
    var fileUploadLimitToOneUploadTemplate = "#fileupload_limit_to_one_upload_template";

    // Containers
    var fileUploadRenderedTagging = "#fileupload_rendered_tagging";
    var fileUploadContainer = "#fileupload_container";
    var fileUploadAddToTemplateContainer = "#fileupload_add_to_template_container";
    var fileuploadLimitContainer = "#fileupload_limit_container";

    // Paths
    var uploadPath = "/system/pool/createfile";
    var userId = sakai.data.me.user.userid;
    var userStoragePrefix = sakai.data.me.user.userStoragePrefix;
    var tagsPath = "/tags/";
    var tagsPathForLinking = "/tags/";

    // i18n
    var fileUploadFilesUploaded = "#fileupload_files_uploaded";
    var fileUploadFilesNotUploaded = "#fileupload_files_not_uploaded";
    var fileUploadDescriptionNameSet= "#fileupload_description_name_set";
    var fileUploadDescriptionNameNotSet = "#fileupload_description_name_not_set";<commit_msg>NOJIRA: resetting tagging for now, this isn't working<commit_after>/*
 * Licensed to the Sakai Foundation (SF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The SF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 */

/*global $, Querystring, fluid, sakai */

/**
 * @name sakai.fileupload
 *
 * @class fileupload
 *
 * @description
 * Initialize the fileupload widget
 *
 * @version 0.0.1
 * @param {String} tuid Unique id of the widget
 * @param {Boolean} showSettings Show the settings of the widget or not
 */
sakai.fileupload = function(tuid, showSettings){


    /////////////////////////////
    // Configuration variables //
    /////////////////////////////

    var $rootel = $("#" + tuid);

    // All files that need to have been uploaded
    var uploadedFiles;
    var tags = [];

    var setDescriptionandName = false;
    var filesUploaded = false;
    var filesTagged = false;
    var tagsCreated = false;
    var setPermissions = false;

    var groupContext = false;
    var newVersion = false;
    var uploadedLink = false;
    var newVersionIsLink = false;
    var oldVersionPath = "";
    var context = "";

    // Classes
    var multiFileRemove = ".MultiFile-remove";
    var fileUploadProgress = "fileupload_upload_progress";
    var multiFileList = ".MultiFile-list";

    // ID
    var fileUploadAddDescription = "#fileupload_add_description";
    var multiFileUpload = "#multifile_upload";
    var newUploaderForm = "#new_uploader form";
    var fileUploadUploadContent = "#upload_content";
    var fileUploadAddTags = "#fileupload_add_tags";
    var fileUploadProgressId = "#fileupload_upload_progress";
    var fileUploadPermissionsSelect = "#fileupload_permissions_select";
    var fileUploadWidgetTitle= "#fileupload_widget_title";
    var fileUploadWidgetTitleNewVersion= "#fileupload_widget_title_new_version";
    var fileUploadAddVersionDescription = "#fileupload_add_version_description";

    var fileUploadLinkBoxInput= "#fileupload_link_box_input";
    var fileUploadLinkForm = "#link_form";
    var fileUploadAddLinkButton = "#fileupload_add_link_button";

    // Form
    var multiFileForm = "#multifile_form";
    var fileUploadSubmit = "#fileupload_submit";

    var cancelButton = "#fileupload_cancel";

    // Templates
    var fileUploadTaggingTemplate = "#fileupload_tagging_template";
    var fileUploadAddToTemplate = "#fileupload_add_to_template";
    var fileUploadNoLimitToUploadTemplate = "#fileupload_no_limit_to_upload_template";
    var fileUploadLimitToOneUploadTemplate = "#fileupload_limit_to_one_upload_template";

    // Containers
    var fileUploadRenderedTagging = "#fileupload_rendered_tagging";
    var fileUploadContainer = "#fileupload_container";
    var fileUploadAddToTemplateContainer = "#fileupload_add_to_template_container";
    var fileuploadLimitContainer = "#fileupload_limit_container";

    // Paths
    var uploadPath = "/system/pool/createfile";
    var userId = sakai.data.me.user.userid;
    var userStoragePrefix = sakai.data.me.user.userStoragePrefix;
    var tagsPath = "/~" + userId + "/public/tags/";
    var tagsPathForLinking = "/_user/" + userStoragePrefix + "public/tags/";

    // i18n
    var fileUploadFilesUploaded = "#fileupload_files_uploaded";
    var fileUploadFilesNotUploaded = "#fileupload_files_not_uploaded";
    var fileUploadDescriptionNameSet= "#fileupload_description_name_set";
    var fileUploadDescriptionNameNotSet = "#fileupload_description_name_not_set";
{'fraction_non_alphanumeric': 0.09998768624553626, 'fraction_numerical': 0.002216475803472479, 'mean_word_length': 3.904589371980676, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2971189', 'n_tokens_mistral': 2238, 'n_tokens_neox': 2190, 'n_words': 635}