]> err.no Git - sope/blob - sope-appserver/WEExtensions/WEDropScript.h
new Xcode projects, removed old Xcode project
[sope] / sope-appserver / WEExtensions / WEDropScript.h
1 /*
2   Copyright (C) 2000-2003 SKYRIX Software AG
3
4   This file is part of OGo
5
6   OGo is free software; you can redistribute it and/or modify it under
7   the terms of the GNU Lesser General Public License as published by the
8   Free Software Foundation; either version 2, or (at your option) any
9   later version.
10
11   OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12   WARRANTY; without even the implied warranty of MERCHANTABILITY or
13   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
14   License for more details.
15
16   You should have received a copy of the GNU Lesser General Public
17   License along with OGo; see the file COPYING.  If not, write to the
18   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19   02111-1307, USA.
20 */
21 /* automatically generated from WEDropScript.js, do not edit ! */
22 @"<SCRIPT LANGUAGE=\"JScript\">\n"
23 @"<!--\n"
24 @"function fnGetInfo(dropElem, myurl) {\n"
25 @"  event.returnValue = false;\n"
26 @"  event.dataTransfer.dropEffect = \"none\";\n"
27 @"  myData = event.dataTransfer.getData(\"Text\");\n"
28 @"  myData = myData.split('?');\n"
29 @"  myType = myData[1];\n"
30 @"  myID   = myData[0];\n"
31 @"  event.dataTransfer.clearData(\"Text\");\n"
32 @"  this.location=''+myurl+'?'+myID+'='+myType;\n"
33 @"  this.status='url:'+myurl+' data'+myData;\n"
34 @"}\n"
35 @"function fnCancelDefault(validObj, effect) {\n"
36 @"  myData = event.dataTransfer.getData(\"Text\");\n"
37 @"  myData = myData.split('?');\n"
38 @"  myType = myData[1];\n"
39 @"  myID   = myData[0];\n"
40 @"  if ((validObj.indexOf(myType) != -1) || (validObj == '*')) {\n"
41 @"    event.returnValue = false;\n"
42 @"    event.dataTransfer.dropEffect = effect;\n"
43 @"  }\n"
44 @"  else {\n"
45 @"    event.returnValue = false;\n"
46 @"    event.dataTransfer.dropEffect = \"none\";\n"
47 @"  }\n"
48 @"}\n"
49 @"var WODropContainerBgColor = new Array(); \n"
50 @"function dropFieldSwapColor(obj,color) {\n"
51 @"  if (color && event.dataTransfer.dropEffect == 'none') return false;\n"
52 @"  if (color) {\n"
53 @"    if (!WODropContainerBgColor[obj.id]) {\n"
54 @"      WODropContainerBgColor[obj.id] = obj.bgColor;\n"
55 @"    }\n"
56 @"    color = WODropContainerBgColor[obj.id];\n"
57 @"    color = lighterColor(color);\n"
58 @"  } else {\n"
59 @"    color = WODropContainerBgColor[obj.id];\n"
60 @"  }\n"
61 @"  obj.bgColor = color;\n"
62 @"}\n"
63 @"      \n"
64 @"var lightAddition = 20;\n"
65 @"var hex = '0123456789ABCDEF';\n"
66 @"function convertHexToDec(h) {\n"
67 @"  h1 = hex.indexOf(h.substr(0,1).toUpperCase());\n"
68 @"  h2 = hex.indexOf(h.substr(1,1).toUpperCase());\n"
69 @"  return (h1 * 16 + h2);\n"
70 @"}\n"
71 @"function convertDecToHex(d) {\n"
72 @"  if (d >= 255) return 'FF';\n"
73 @"  if (d <= 0)   return '00';\n"
74 @"  d2 = d % 16; d1 = parseInt((d-d2) / 16);\n"
75 @"  return hex.substr(d1,1)+hex.substr(d2,1);\n"
76 @"}\n"
77 @"function lighterColor(c) {\n"
78 @"  if (!c) return c;\n"
79 @"  if ((c.length != 7) || (c.substr(0,1) != '#')) return c;\n"
80 @"  r = convertDecToHex(convertHexToDec(c.substr(1,2)) + lightAddition);\n"
81 @"  g = convertDecToHex(convertHexToDec(c.substr(3,2)) + lightAddition);\n"
82 @"  b = convertDecToHex(convertHexToDec(c.substr(5,2)) + lightAddition);\n"
83 @"  return '#'+r+g+b;\n"
84 @"}\n"
85 @"// -->\n"
86 @"</SCRIPT>\n"