<commit_before>/**
 * Copyright (C) 2011 Instructure, Inc.
 *
 * This file is part of Canvas.
 *
 * Canvas is free software: you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License as published by the Free
 * Software Foundation, version 3 of the License.
 *
 * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
define([
  'i18n!media_comments',
  'jquery' /* $ */,
  'str/htmlEscape',
  'jquery.ajaxJSON' /* ajaxJSON */,
  'jquery.instructure_jquery_patches' /* /\.dialog/ */,
  'jquery.instructure_misc_helpers' /* /\$\.h/, /\$\.fileSize/ */,
  'jquery.instructure_misc_plugins' /* .dim, /\.log\(/ */,
  'jqueryui/progressbar' /* /\.progressbar/ */,
  'jqueryui/tabs' /* /\.tabs/ */
], function(I18n, $, htmlEscape) {

  (function($, INST){
    var yourVersion = null;
    try {
      yourVersion = swfobject.getFlashPlayerVersion().major + "." + swfobject.getFlashPlayerVersion().minor;
      yourVersion = " (you have " + yourVersion + " installed)";
    } catch(e) {
    }
    var flashRequiredMessage = "<div>" + htmlEscape(I18n.t('messages.flash_required', "This video requires Flash version 9 or higher (you have %{version} installed).", { version: yourVersion })) +
            "<br/><a target='_blank' href='http://get.adobe.com/flashplayer/'>" + htmlEscape(I18n.t('links.upgrade_flash', "Click here to upgrade")) +"</a></div>";
    $.fn.mediaComment = function(command, arg1, arg2, arg3, arg4, arg5) {
      var id = arg1, mediaType = arg2, downloadUrl = arg3;
      if(!INST.kalturaSettings) { console.log('Kaltura has not been enabled for this account'); return; }
      if(command == 'create') {
        mediaType = arg1;
        var callback = arg2;
        var cancel_callback = arg3;
        var modal = arg4;
        var defaultTitle = arg5;
        $("#media_recorder_container").removeAttr('id').addClass('old_recorder_container');
        this.attr('id', 'media_recorder_container').removeClass('old_recorder_container');
        $(document).unbind('media_comment_created');
        var $comment = this;
        $(document).bind('media_comment_created', function(event, data) {
          callback.call(this, data.id, data.mediaType);
        });
        $.mediaComment.init(mediaType, {
          modal: modal,
          close: function() {
            if(cancel_callback && $.isFunction(cancel_callback)) {
              cancel_callback.call($comment);
            }
          },
          defaultTitle: defaultTitle
        });
      } else if(command == 'show_inline') {
        var $div = $("<span/>");
        if(mediaType != 'video' && mediaType != 'audio') {
          if($(this).hasClass('audio_playback')) {
            mediaType = 'audio';
          } else {
            mediaType = 'video';
          }
        }
        $div.attr('id', 'media_comment_holder_' + Math.round(Math.random() * 10000));
        var $holder = $(this);
        if($(this).parent(".instructure_file_link_holder").length > 0) {
          $holder = $(this).parent(".instructure_file_link_holder");
        }
        var showInline = function(id) {<commit_msg>made tinymce record media non-modal closes #7035<commit_after>/**
 * Copyright (C) 2011 Instructure, Inc.
 *
 * This file is part of Canvas.
 *
 * Canvas is free software: you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License as published by the Free
 * Software Foundation, version 3 of the License.
 *
 * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
define([
  'i18n!media_comments',
  'jquery' /* $ */,
  'str/htmlEscape',
  'jquery.ajaxJSON' /* ajaxJSON */,
  'jquery.instructure_jquery_patches' /* /\.dialog/ */,
  'jquery.instructure_misc_helpers' /* /\$\.h/, /\$\.fileSize/ */,
  'jquery.instructure_misc_plugins' /* .dim, /\.log\(/ */,
  'jqueryui/progressbar' /* /\.progressbar/ */,
  'jqueryui/tabs' /* /\.tabs/ */
], function(I18n, $, htmlEscape) {

  (function($, INST){
    var yourVersion = null;
    try {
      yourVersion = swfobject.getFlashPlayerVersion().major + "." + swfobject.getFlashPlayerVersion().minor;
      yourVersion = " (you have " + yourVersion + " installed)";
    } catch(e) {
    }
    var flashRequiredMessage = "<div>" + htmlEscape(I18n.t('messages.flash_required', "This video requires Flash version 9 or higher (you have %{version} installed).", { version: yourVersion })) +
            "<br/><a target='_blank' href='http://get.adobe.com/flashplayer/'>" + htmlEscape(I18n.t('links.upgrade_flash', "Click here to upgrade")) +"</a></div>";
    $.fn.mediaComment = function(command, arg1, arg2, arg3, arg4) {
      var id = arg1, mediaType = arg2, downloadUrl = arg3;
      if(!INST.kalturaSettings) { console.log('Kaltura has not been enabled for this account'); return; }
      if(command == 'create') {
        mediaType = arg1;
        var callback = arg2;
        var cancel_callback = arg3;
        var defaultTitle = arg4;
        $("#media_recorder_container").removeAttr('id').addClass('old_recorder_container');
        this.attr('id', 'media_recorder_container').removeClass('old_recorder_container');
        $(document).unbind('media_comment_created');
        var $comment = this;
        $(document).bind('media_comment_created', function(event, data) {
          callback.call(this, data.id, data.mediaType);
        });
        $.mediaComment.init(mediaType, {
          modal: false,
          close: function() {
            if(cancel_callback && $.isFunction(cancel_callback)) {
              cancel_callback.call($comment);
            }
          },
          defaultTitle: defaultTitle
        });
      } else if(command == 'show_inline') {
        var $div = $("<span/>");
        if(mediaType != 'video' && mediaType != 'audio') {
          if($(this).hasClass('audio_playback')) {
            mediaType = 'audio';
          } else {
            mediaType = 'video';
          }
        }
        $div.attr('id', 'media_comment_holder_' + Math.round(Math.random() * 10000));
        var $holder = $(this);
        if($(this).parent(".instructure_file_link_holder").length > 0) {
          $holder = $(this).parent(".instructure_file_link_holder");
        }
        var showInline = function(id) {
{'fraction_non_alphanumeric': 0.1501662089897384, 'fraction_numerical': 0.009828009828009828, 'mean_word_length': 2.8508625486922647, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1671004', 'n_tokens_mistral': 2089, 'n_tokens_neox': 2029, 'n_words': 520}