<commit_before>/*
@version $Id$
@package Abricos
@copyright Copyright (C) 2011 Abricos All rights reserved.
@license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/

var Component = new Brick.Component();
Component.requires = {
	mod:[
		{name: 'sys', files: ['container.js', 'editor.js']},
        {name: 'uprofile', files: ['users.js']},
        {name: 'botask', files: ['lib.js', 'roles.js', 'calendar.js']}
	]
};
Component.entryPoint = function(){
	
	var Dom = YAHOO.util.Dom,
		E = YAHOO.util.Event,
		L = YAHOO.lang;
	
	var NS = this.namespace, 
		TMG = this.template,
		API = NS.API,
		R = NS.roles;
	
	var UP = Brick.mod.uprofile;
	
	Brick.util.CSS.update(Brick.util.CSS['botask']['taskeditor']);	

	var buildTemplate = function(w, ts){w._TM = TMG.build(ts); w._T = w._TM.data; w._TId = w._TM.idManager;};

	var TaskEditorPanel = function(task){
		this.task = task;

		TaskEditorPanel.superclass.constructor.call(this, {fixedcenter: true});
	};
	YAHOO.extend(TaskEditorPanel, Brick.widget.Panel, {
		initTemplate: function(){
			buildTemplate(this, 'panel');
			
			var task = this.task;
			return this._TM.replace('panel', {
				'pid': L.isNull(task.parent) ? 0 : task.parent.id,
				'ptitle': L.isNull(task.parent) ? '' : task.parent.title
			});
		},
		onLoad: function(){
			var TM = this._TM,
				task = this.task;
			
			this.navigate = new NS.TaskNavigateWidget(TM.getEl('panel.nav'), task);
			
			Dom.setStyle(TM.getEl('panel.tl'+(task.id*1 > 0 ? 'new' : 'edit')), 'display', 'none');
			
			if (!L.isNull(task.parent)){
				Dom.setStyle(TM.getEl('panel.navtask'), 'display', '');
			}
			
			var Editor = Brick.widget.Editor;
			this.editor = new Editor(this._TId['panel']['editor'], {
				width: '750px', height: '250px', 'mode': Editor.MODE_VISUAL
			});
			
			TM.getEl('panel.tl').value = task.title;
			this.editor.setContent(task.descript);
			
			var users = task.id*1==0 && !L.isNull(task.parent) ? task.parent.users : task.users;
			
			this.usersWidget = new UP.UserSelectWidget(TM.getEl('panel.users'), users);
			this.ddlDateTime = new NS.DateInputWidget(TM.getEl('panel.ddl'), {
				'date': task.deadline,
				'showTime': task.ddlTime
			});
			
			TM.getEl('panel.prt').value = task.priority;
		},
		onClick: function(el){
			var tp = this._TId['panel'];
			switch(el.id){
			
			case tp['bsave']: this.saveTask(); return true;
			case tp['bcancel']: this.close(); return true;
			}
			return false;
		},
		saveTask: function(){
			var TM = this._TM,
				task = this.task,
				users = this.usersWidget.getSelectedUsers();
			<commit_msg>Менеджер задач: исправлена ошибка для новой версии редактора TinyMCE<commit_after>/*
@version $Id$
@package Abricos
@copyright Copyright (C) 2011 Abricos All rights reserved.
@license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/

var Component = new Brick.Component();
Component.requires = {
	mod:[
		{name: 'sys', files: ['container.js', 'editor.js']},
        {name: 'uprofile', files: ['users.js']},
        {name: 'botask', files: ['lib.js', 'roles.js', 'calendar.js']}
	]
};
Component.entryPoint = function(){
	
	var Dom = YAHOO.util.Dom,
		E = YAHOO.util.Event,
		L = YAHOO.lang;
	
	var NS = this.namespace, 
		TMG = this.template,
		API = NS.API,
		R = NS.roles;
	
	var UP = Brick.mod.uprofile;
	
	Brick.util.CSS.update(Brick.util.CSS['botask']['taskeditor']);	

	var buildTemplate = function(w, ts){w._TM = TMG.build(ts); w._T = w._TM.data; w._TId = w._TM.idManager;};

	var TaskEditorPanel = function(task){
		this.task = task;

		TaskEditorPanel.superclass.constructor.call(this, {fixedcenter: true});
	};
	YAHOO.extend(TaskEditorPanel, Brick.widget.Panel, {
		initTemplate: function(){
			buildTemplate(this, 'panel');
			
			var task = this.task;
			return this._TM.replace('panel', {
				'pid': L.isNull(task.parent) ? 0 : task.parent.id,
				'ptitle': L.isNull(task.parent) ? '' : task.parent.title
			});
		},
		onLoad: function(){
			var TM = this._TM,
				task = this.task;
			
			this.navigate = new NS.TaskNavigateWidget(TM.getEl('panel.nav'), task);
			
			Dom.setStyle(TM.getEl('panel.tl'+(task.id*1 > 0 ? 'new' : 'edit')), 'display', 'none');
			
			if (!L.isNull(task.parent)){
				Dom.setStyle(TM.getEl('panel.navtask'), 'display', '');
			}
			

			TM.getEl('panel.tl').value = task.title;
			TM.getEl('panel.editor').innerHTML = task.descript;

			var Editor = Brick.widget.Editor;
			this.editor = new Editor(this._TId['panel']['editor'], {
				width: '750px', height: '250px', 'mode': Editor.MODE_VISUAL
			});
			
			var users = task.id*1==0 && !L.isNull(task.parent) ? task.parent.users : task.users;
			
			this.usersWidget = new UP.UserSelectWidget(TM.getEl('panel.users'), users);
			this.ddlDateTime = new NS.DateInputWidget(TM.getEl('panel.ddl'), {
				'date': task.deadline,
				'showTime': task.ddlTime
			});
			
			TM.getEl('panel.prt').value = task.priority;
		},
		onClick: function(el){
			var tp = this._TId['panel'];
			switch(el.id){
			
			case tp['bsave']: this.saveTask(); return true;
			case tp['bcancel']: this.close(); return true;
			}
			return false;
		},
		saveTask: function(){
			var TM = this._TM,
				task = this.task,
				users = this.usersWidget.getSelectedUsers();
			
{'fraction_non_alphanumeric': 0.1858288770053476, 'fraction_numerical': 0.005729564553093965, 'mean_word_length': 3.4456706281833616, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4776433', 'n_tokens_mistral': 2225, 'n_tokens_neox': 1921, 'n_words': 365}