Skip to content

Commit

Permalink
WebAccess: moved CSS/JS code out of QLC+
Browse files Browse the repository at this point in the history
The resources needed are now separate files loaded upon request that can be modified by users
  • Loading branch information
mcallegari committed Oct 24, 2014
1 parent 5e05397 commit fda47e2
Show file tree
Hide file tree
Showing 52 changed files with 1,074 additions and 1,291 deletions.
3 changes: 3 additions & 0 deletions engine/src/src.pro
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ macx {
conf.commands += echo \"$$LITERAL_HASH define RGBSCRIPTDIR \\\"$$RGBSCRIPTDIR\\\"\" >> $$CONFIGFILE &&
conf.commands += echo \"$$LITERAL_HASH define USERRGBSCRIPTDIR \\\"$$USERRGBSCRIPTDIR\\\"\" >> $$CONFIGFILE &&
conf.commands += echo \"$$LITERAL_HASH define GOBODIR \\\"$$GOBODIR\\\"\" >> $$CONFIGFILE &&
conf.commands += echo \"$$LITERAL_HASH define WEBFILESDIR \\\"$$WEBFILESDIR\\\"\" >> $$CONFIGFILE &&
conf.commands += echo \"$$LITERAL_HASH endif\" >> $$CONFIGFILE
}
unix:!macx {
Expand All @@ -306,6 +307,7 @@ unix:!macx {
conf.commands += echo \"$$LITERAL_HASH define RGBSCRIPTDIR \\\"$$INSTALLROOT/$$RGBSCRIPTDIR\\\"\" >> $$CONFIGFILE &&
conf.commands += echo \"$$LITERAL_HASH define USERRGBSCRIPTDIR \\\"$$USERRGBSCRIPTDIR\\\"\" >> $$CONFIGFILE &&
conf.commands += echo \"$$LITERAL_HASH define GOBODIR \\\"$$INSTALLROOT/$$GOBODIR\\\"\" >> $$CONFIGFILE &&
conf.commands += echo \"$$LITERAL_HASH define WEBFILESDIR \\\"$$INSTALLROOT/$$WEBFILESDIR\\\"\" >> $$CONFIGFILE &&
conf.commands += echo \"$$LITERAL_HASH endif\" >> $$CONFIGFILE
}
win32 {
Expand All @@ -329,5 +331,6 @@ win32 {
conf.commands += @echo $$LITERAL_HASH define RGBSCRIPTDIR \"$$RGBSCRIPTDIR\" >> $$CONFIGFILE &&
conf.commands += @echo $$LITERAL_HASH define USERRGBSCRIPTDIR \"$$USERRGBSCRIPTDIR\" >> $$CONFIGFILE &&
conf.commands += @echo $$LITERAL_HASH define GOBODIR \"$$GOBODIR\" >> $$CONFIGFILE &&
conf.commands += @echo $$LITERAL_HASH define WEBFILESDIR \"$$WEBFILESDIR\" >> $$CONFIGFILE &&
conf.commands += @echo $$LITERAL_HASH endif >> $$CONFIGFILE
}
4 changes: 2 additions & 2 deletions main/main.pro
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ TARGET = qlcplus

INCLUDEPATH += ../ui/src ../ui/src/virtualconsole
INCLUDEPATH += ../engine/src
INCLUDEPATH += ../webaccess
INCLUDEPATH += ../webaccess/src

QMAKE_LIBDIR += ../ui/src
QMAKE_LIBDIR += ../engine/src
QMAKE_LIBDIR += ../webaccess
QMAKE_LIBDIR += ../webaccess/src
LIBS += -lqlcplusengine
LIBS += -lqlcplusui
LIBS += -lqlcpluswebaccess
Expand Down
65 changes: 0 additions & 65 deletions ui/src/virtualconsole/vcaudiotriggers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,71 +494,6 @@ void VCAudioTriggers::editProperties()
m_inputCapture->setBandsNumber(m_spectrumBars.count());
}

/*********************************************************************
* Web access
*********************************************************************/

QString VCAudioTriggers::getCSS()
{
QString str = "<style type=\"text/css\" media=\"screen\">\n"
".vcaudiotriggers {\n"
" position: absolute;\n"
" border: 1px solid #777777;\n"
" border-radius: 4px;\n"
"}\n"

".vcaudioHeader {\n"
" background: linear-gradient(to bottom, #345D27 0%, #0E1A0A 100%);\n"
" background: -ms-linear-gradient(top, #345D27 0%, #0E1A0A 100%);\n"
" background: -moz-linear-gradient(top, #345D27 0%, #0E1A0A 100%);\n"
" background: -o-linear-gradient(top, #345D27 0%, #0E1A0A 100%);\n"
" background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #345D27), color-stop(1, #0E1A0A));\n"
" background: -webkit-linear-gradient(top, #345D27 0%, #0E1A0A 100%);\n"
" border-radius: 3px;\n"
" height: 32px;\n"
" margin: 2px;\n"
" padding: 0 0 0 3px;\n"
" font:normal 20px/1.2em sans-serif;\n"
"}\n"

".vcatbutton-wrapper {\n"
"position: absolute;\n"
"}\n\n"

".vcatbutton {\n"
"display: table-cell;\n"
"border: 3px solid #A0A0A0;\n"
"border-radius: 4px;\n"
"font-family: arial, verdana, sans-serif;\n"
" text-decoration: none;\n"
"text-align:center;\n"
"vertical-align: middle;\n"
"}\n"

"</style>\n";
return str;
}

QString VCAudioTriggers::getJS()
{
QString str = "function atButtonClick(id) {\n"
" var obj = document.getElementById(id);\n"
" if (obj.value == \"0\" || obj.value == undefined) {\n"
" obj.value = \"255\";\n"
" obj.style.border = \"3px solid #00E600\";\n"
" obj.style.backgroundColor = \"#D7DE75\";\n"
" }\n"
" else {\n"
" obj.value = \"0\";\n"
" obj.style.border = \"3px solid #A0A0A0\";\n"
" obj.style.backgroundColor = \"#D6D2D0\";\n"
" }\n"
" var btnMsg = id + \"|\" + obj.value;\n"
" websocket.send(btnMsg);\n"
"};\n";
return str;
}

/*********************************************************************
* Load & Save
*********************************************************************/
Expand Down
10 changes: 0 additions & 10 deletions ui/src/virtualconsole/vcaudiotriggers.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,6 @@ protected slots:
/** @reimp */
void editProperties();

/*********************************************************************
* Web access
*********************************************************************/
public:
/** @reimpl */
QString getCSS();

/** @reimpl */
QString getJS();

/*************************************************************************
* Configuration
*************************************************************************/
Expand Down
42 changes: 0 additions & 42 deletions ui/src/virtualconsole/vcbutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -762,48 +762,6 @@ void VCButton::adjustIntensity(qreal val)
VCWidget::adjustIntensity(val);
}

/*********************************************************************
* Web access
*********************************************************************/

QString VCButton::getCSS()
{
QString str = "<style type=\"text/css\" media=\"screen\">\n"
".vcbutton-wrapper {\n"
"position: absolute;\n"
"}\n\n"

".vcbutton {\n"
"display: table-cell;\n"
"border: 3px solid #A0A0A0;\n"
"border-radius: 4px;\n"
"font-family: arial, verdana, sans-serif;\n"
"text-decoration: none;\n"
"text-align:center;\n"
"vertical-align: middle;\n"
"}\n"
"</style>\n";

return str;
}

QString VCButton::getJS()
{
QString str = "function buttonClick(id) {\n"
" var obj = document.getElementById(id);\n"
" if (obj.value == \"0\" || obj.value == undefined) {\n"
" obj.value = \"255\";\n"
" obj.style.border = \"3px solid #00E600\";\n"
" }\n"
" else {\n"
" obj.value = \"0\";\n"
" obj.style.border = \"3px solid #A0A0A0\";\n"
" }\n"
" websocket.send(id + \"|\" + obj.value);\n"
"}\n";
return str;
}

/*****************************************************************************
* Load & Save
*****************************************************************************/
Expand Down
10 changes: 0 additions & 10 deletions ui/src/virtualconsole/vcbutton.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,16 +340,6 @@ protected slots:
/** @reimp */
void adjustIntensity(qreal val);

/*********************************************************************
* Web access
*********************************************************************/
public:
/** @reimpl */
QString getCSS();

/** @reimpl */
QString getJS();

/*********************************************************************
* Load & Save
*********************************************************************/
Expand Down
112 changes: 0 additions & 112 deletions ui/src/virtualconsole/vccuelist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1042,118 +1042,6 @@ void VCCueList::editProperties()
m_doc->setModified();
}

QString VCCueList::getCSS()
{
QString str = "<style type=\"text/css\" media=\"screen\">\n"
".vccuelist {\n"
"position: absolute;\n"
"border: 1px solid #777777;\n"
"border-radius: 3px;\n"
"}\n"

".vccuelistButton {\n"
" display: inline-block;\n"
" vertical-align: top;\n"
" background: linear-gradient(to bottom, #F6F6F6 0%, #DFDDDC 100%);\n"
" background: -ms-linear-gradient(top, #F6F6F6 0%, #DFDDDC 100%);\n"
" background: -moz-linear-gradient(top, #F6F6F6 0%, #DFDDDC 100%);\n"
" background: -o-linear-gradient(top, #F6F6F6 0%, #DFDDDC 100%);\n"
" background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #F6F6F6), color-stop(1, #DFDDDC));\n"
" background: -webkit-linear-gradient(top, #F6F6F6 0%, #DFDDDC 100%);\n"
" border-radius: 3px;\n"
" border: 1px solid #808080;\n"
" margin: 2px 2px 0 0;\n"
" padding: 1px;\n"
" height: 27px;\n"
" width: 30%;\n"
" text-align: center;\n"
"}\n"

".vccuelistButton:active { background: #868585; }\n"

"table.hovertable {\n"
" font-family: verdana,arial,sans-serif;\n"
" font-size:11px;\n"
" color:#333333;\n"
" border-width: 1px;\n"
" border-color: #999999;\n"
" border-collapse: collapse;\n"
"}\n"

"table.hovertable th {\n"
" background-color:#DCD9D6;\n"
" border-width: 1px;\n"
" padding: 3px;\n"
" border-style: solid;\n"
" border-color: #a9c6c9;\n"
" text-align: left;\n"
"}\n"

"table.hovertable tr {\n"
" background-color:#ffffff;\n"
"}\n"

"table.hovertable td {\n"
" border-width: 1px;\n"
" padding: 3px;\n"
" border-style: solid;\n"
" border-color: #a9c6c9;\n"
"}\n"

"</style>\n";

return str;
}

QString VCCueList::getJS()
{
QString str =
"var cueListsIndices = new Array();\n\n"

"function setCueIndex(id, idx) {\n"
" var oldIdx = cueListsIndices[id];\n"
" if (oldIdx != undefined && oldIdx != -1) {\n"
" var oldCueObj = document.getElementById(id + \"_\" + oldIdx);\n"
" oldCueObj.style.backgroundColor='#FFFFFF';\n"
" }\n"
" cueListsIndices[id] = idx;\n"
" var currCueObj = document.getElementById(id + \"_\" + idx);\n"
" if (idx != \"-1\")\n"
" currCueObj.style.backgroundColor='#5E7FDF';\n"
"}\n"

"function sendCueCmd(id, cmd) {\n"
" if (cmd == \"PLAY\") {\n"
" var obj = document.getElementById(\"play\" + id);\n"
" if (cueListsIndices[id] == -1) {\n"
" obj.innerHTML = \"<img src=\\\"player_stop.png\\\" width=\\\"27\\\">\";\n"
" setCueIndex(id, 0);\n"
" }\n"
" else {\n"
" obj.innerHTML = \"<img src=\\\"player_play.png\\\" width=\\\"27\\\">\";\n"
" setCueIndex(id, -1);\n"
" }\n"
" }\n"
" websocket.send(id + \"|\" + cmd);\n"
"}\n"

"function checkMouseOut(id, idx) {\n"
" var obj = document.getElementById(id + \"_\" + idx);\n"
" if(idx == cueListsIndices[id])\n"
" obj.style.backgroundColor='#5E7FDF';\n"
" else\n"
" obj.style.backgroundColor='#FFFFFF';\n"
" }\n"

"function enableCue(id, idx) {\n"
" var btnObj = document.getElementById(\"play\" + id);\n"
" btnObj.innerHTML = \"<img src=\\\"player_stop.png\\\" width=\\\"27\\\">\";\n"
" setCueIndex(id, idx);\n"
" websocket.send(id + \"|STEP|\" + idx);\n"
"}\n";
return str;
}

void VCCueList::playCueAtIndex(int idx)
{
if (mode() != Doc::Operate)
Expand Down
6 changes: 0 additions & 6 deletions ui/src/virtualconsole/vccuelist.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,12 +285,6 @@ protected slots:
* Web access
*********************************************************************/
public:
/** @reimpl */
QString getCSS();

/** @reimpl */
QString getJS();

/** Play a specific cue at the given index */
void playCueAtIndex(int idx);

Expand Down

0 comments on commit fda47e2

Please sign in to comment.