first commit
This commit is contained in:
commit
4d332ef662
27586 changed files with 3281783 additions and 0 deletions
137
rus/admin/_V4/_lib/openwysiwyg/scripts/wysiwyg-color.js
Normal file
137
rus/admin/_V4/_lib/openwysiwyg/scripts/wysiwyg-color.js
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
/********************************************************************
|
||||
* openWYSIWYG color chooser Copyright (c) 2006 openWebWare.com
|
||||
* Contact us at devs@openwebware.com
|
||||
* This copyright notice MUST stay intact for use.
|
||||
*
|
||||
* $Id: wysiwyg-color.js,v 1.1 2007/01/29 19:19:49 xhaggi Exp $
|
||||
********************************************************************/
|
||||
function WYSIWYG_Color() {
|
||||
|
||||
// colors
|
||||
var COLORS = new Array(
|
||||
"#000000","#993300","#333300","#003300","#003366","#000080",
|
||||
"#333399","#333333","#800000","#FF6600","#808000","#008000",
|
||||
"#008080","#0000FF","#666699","#808080","#FF0000","#FF9900",
|
||||
"#99CC00","#339966","#33CCCC","#3366FF","#800080","#999999",
|
||||
"#FF00FF","#FFCC00","#FFFF00","#00FF00","#00CCFF","#993366",
|
||||
"#C0C0C0","#FF99CC","#FFCC99","#FFFF99","#CCFFCC","#CCFFFF",
|
||||
"#99CCFF","#666699","#777777","#999999","#EEEEEE","#FFFFFF"
|
||||
);
|
||||
|
||||
// div id of the color table
|
||||
var CHOOSER_DIV_ID = "colorpicker-div";
|
||||
|
||||
/**
|
||||
* Init the color picker
|
||||
*/
|
||||
this.init = function() {
|
||||
var div = document.createElement("DIV");
|
||||
div.id = CHOOSER_DIV_ID;
|
||||
div.style.position = "absolute";
|
||||
div.style.visibility = "hidden";
|
||||
document.body.appendChild(div);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Open the color chooser to choose a color.
|
||||
*
|
||||
* @param {String} element Element identifier
|
||||
*/
|
||||
this.choose = function(element) {
|
||||
var div = document.getElementById(CHOOSER_DIV_ID);
|
||||
if(div == null) {
|
||||
alert("Initialisation of color picker failed.");
|
||||
return;
|
||||
}
|
||||
|
||||
// writes the content of the color picker
|
||||
write(element);
|
||||
|
||||
// Display color picker
|
||||
var x = window.event.clientX + document.body.scrollLeft;
|
||||
var y = window.event.clientY + document.body.scrollTop;
|
||||
var winsize = windowSize();
|
||||
if(x + div.offsetWidth > winsize.width) x = winsize.width - div.offsetWidth - 5;
|
||||
if(y + div.offsetHeight > winsize.height) y = winsize.height - div.offsetHeight - 5;
|
||||
div.style.left = x + "px";
|
||||
div.style.top = y + "px";
|
||||
div.style.visibility = "visible";
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the color in the given field
|
||||
*
|
||||
* @param {String} n Element identifier
|
||||
* @param {String} color HexColor String
|
||||
*/
|
||||
this.select = function(n, color) {
|
||||
var div = document.getElementById(CHOOSER_DIV_ID);
|
||||
var elm = document.getElementById(n);
|
||||
elm.value = color;
|
||||
elm.style.color = color;
|
||||
elm.style.backgroundColor = color;
|
||||
div.style.visibility = "hidden";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Write the color table
|
||||
* @param {String} n Element identifier
|
||||
* @private
|
||||
*/
|
||||
function write(n) {
|
||||
|
||||
var div = document.getElementById(CHOOSER_DIV_ID);
|
||||
|
||||
var output = "";
|
||||
output += '<table border="1" cellpadding="0" cellspacing="0" class="wysiwyg-color-picker-table"><tr>';
|
||||
for(var i = 0; i < COLORS.length;i++) {
|
||||
var color = COLORS[i];
|
||||
output += '<td class="selectColorBorder" ';
|
||||
output += 'onmouseover="this.className=\'selectColorOn\';" ';
|
||||
output += 'onmouseout="this.className=\'selectColorOff\';" ';
|
||||
output += 'onclick="WYSIWYG_ColorInst.select(\'' + n + '\', \'' + color + '\');"> ';
|
||||
output += '<div style="background-color:' + color + ';" class="wysiwyg-color-picker-div"> </div> ';
|
||||
output += '</td>';
|
||||
|
||||
if(((i+1) % Math.round(Math.sqrt(COLORS.length))) == 0) {
|
||||
output += "</tr><tr>";
|
||||
}
|
||||
}
|
||||
|
||||
output += '</tr></table>';
|
||||
|
||||
// write to div element
|
||||
div.innerHTML = output;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the window.event on Mozilla Browser
|
||||
* @private
|
||||
*/
|
||||
function _event_tracker(event) {
|
||||
if (!document.all && document.getElementById) {
|
||||
window.event = event;
|
||||
}
|
||||
}
|
||||
document.onmousedown = _event_tracker;
|
||||
|
||||
/**
|
||||
* Get the window size
|
||||
* @private
|
||||
*/
|
||||
function windowSize() {
|
||||
if (window.innerWidth) {
|
||||
return {width: window.innerWidth, height: window.innerHeight};
|
||||
}
|
||||
else if (document.body && document.body.offsetWidth) {
|
||||
return {width: document.body.offsetWidth, height: document.body.offsetHeight};
|
||||
}
|
||||
else {
|
||||
return {width: 0, height: 0};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var WYSIWYG_ColorInst = new WYSIWYG_Color();
|
||||
38
rus/admin/_V4/_lib/openwysiwyg/scripts/wysiwyg-popup.js
Normal file
38
rus/admin/_V4/_lib/openwysiwyg/scripts/wysiwyg-popup.js
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/********************************************************************
|
||||
* openWYSIWYG popup functions Copyright (c) 2006 openWebWare.com
|
||||
* Contact us at devs@openwebware.com
|
||||
* This copyright notice MUST stay intact for use.
|
||||
*
|
||||
* $Id: wysiwyg-popup.js,v 1.2 2007/01/22 23:45:30 xhaggi Exp $
|
||||
********************************************************************/
|
||||
var WYSIWYG_Popup = {
|
||||
|
||||
/**
|
||||
* Return the value of an given URL parameter.
|
||||
*
|
||||
* @param param Parameter
|
||||
* @return Value of the given parameter
|
||||
*/
|
||||
getParam: function(param) {
|
||||
var query = window.location.search.substring(1);
|
||||
var parms = query.split('&');
|
||||
for (var i=0; i<parms.length; i++) {
|
||||
var pos = parms[i].indexOf('=');
|
||||
if (pos > 0) {
|
||||
var key = parms[i].substring(0,pos).toLowerCase();
|
||||
var val = parms[i].substring(pos+1);
|
||||
if(key == param.toLowerCase())
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// close the popup if the opener does not hold the WYSIWYG object
|
||||
if(!window.opener) window.close();
|
||||
|
||||
// bind objects on local vars
|
||||
var WYSIWYG = window.opener.WYSIWYG;
|
||||
var WYSIWYG_Core = window.opener.WYSIWYG_Core;
|
||||
var WYSIWYG_Table = window.opener.WYSIWYG_Table;
|
||||
36
rus/admin/_V4/_lib/openwysiwyg/scripts/wysiwyg-settings.js
Normal file
36
rus/admin/_V4/_lib/openwysiwyg/scripts/wysiwyg-settings.js
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
/********************************************************************
|
||||
* openWYSIWYG settings file Copyright (c) 2006 openWebWare.com
|
||||
* Contact us at devs@openwebware.com
|
||||
* This copyright notice MUST stay intact for use.
|
||||
*
|
||||
* $Id: wysiwyg-settings.js,v 1.4 2007/01/22 23:05:57 xhaggi Exp $
|
||||
********************************************************************/
|
||||
|
||||
/*
|
||||
* Full featured setup used the openImageLibrary addon
|
||||
*/
|
||||
var full = new WYSIWYG.Settings();
|
||||
full.ImagesDir = webApp+"/admin/openwysiwyg/images/";
|
||||
full.PopupsDir = webApp+"/admin/openwysiwyg/popups/";
|
||||
full.CSSFile = webApp+"/admin/openwysiwyg/styles/wysiwyg.css";
|
||||
full.Width = "85%";
|
||||
full.Height = "250px";
|
||||
// customize toolbar buttons
|
||||
full.addToolbarElement("font", 3, 1);
|
||||
full.addToolbarElement("fontsize", 3, 2);
|
||||
full.addToolbarElement("headings", 3, 3);
|
||||
// openImageLibrary addon implementation
|
||||
full.ImagePopupFile = webApp+"/admin/openwysiwyg/addons/imagelibrary/insert_image.php";
|
||||
full.ImagePopupWidth = 600;
|
||||
full.ImagePopupHeight = 245;
|
||||
|
||||
/*
|
||||
* Small Setup Example
|
||||
*/
|
||||
var small = new WYSIWYG.Settings();
|
||||
small.Width = "350px";
|
||||
small.Height = "100px";
|
||||
small.DefaultStyle = "font-family: Arial; font-size: 12px; background-color: #AA99AA";
|
||||
small.Toolbar[0] = new Array("font", "fontsize", "bold", "italic", "underline"); // small setup for toolbar 1
|
||||
small.Toolbar[1] = ""; // disable toolbar 2
|
||||
small.StatusBarEnabled = false;
|
||||
2800
rus/admin/_V4/_lib/openwysiwyg/scripts/wysiwyg.js
Normal file
2800
rus/admin/_V4/_lib/openwysiwyg/scripts/wysiwyg.js
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue