2 * Copyright (C) 2009 Mihai Şucan
4 * This file is part of PaintWeb.
6 * PaintWeb is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * PaintWeb is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with PaintWeb. If not, see <http://www.gnu.org/licenses/>.
19 * $URL: http://code.google.com/p/paintweb $
20 * $Date: 2009-08-19 20:09:54 +0300 $
24 * @author <a lang="ro" href="http://www.robodesign.ro/mihai">Mihai Şucan</a>
25 * @fileOverview This script allows the user to create a new image to edit
26 * inside PaintWeb, directly from TinyMCE.
29 tinyMCEPopup.requireLangPack();
31 tinyMCEPopup.onInit.add(function() {
32 var newImageForm = document.getElementById('newimageform'),
33 imgWidth = document.getElementById('imgWidth'),
34 imgHeight = document.getElementById('imgHeight'),
35 imgBgrColor = document.getElementById('imgBgrColor'),
36 imgTitle = document.getElementById('imgTitle'),
37 altText = document.getElementById('altText'),
38 btnCancel = document.getElementById('cancel');
40 newImageForm.onsubmit = function (ev) {
41 var fn = tinyMCEPopup.getWindowArg('newImageFn');
44 fn(imgWidth.value, imgHeight.value, imgBgrColor.value, altText.value,
51 imgBgrColor.parentNode.lastChild.innerHTML
52 = ' ' + getColorPickerHTML('imgBgrColor_pick',
55 imgBgrColor.onchange = function () { updateColor('imgBgrColor_pick',
58 updateColor('imgBgrColor_pick', 'imgBgrColor');
60 btnCancel.onclick = function () { tinyMCEPopup.close(); };
63 // vim:set spell spl=en fo=wan1croqlt tw=80 ts=2 sw=2 sts=2 sta et ai cin fenc=utf-8 ff=unix: