Skip to content

Commit bfc17b9

Browse files
t-naabusali-hamud
authored andcommitted
Add Colors to code
1 parent 3279068 commit bfc17b9

13 files changed

+4086
-15
lines changed

Diff for: NOTICE.txt

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Microsoft.PowerBI.JavaScript
2+
3+
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
4+
Do Not Translate or Localize
5+
6+
This project incorporates components from the projects listed below. The original copyright notices and the licenses under which Microsoft received such components are set forth below. Microsoft reserves all rights not expressly granted herein, whether by implication, estoppel or otherwise.
7+
8+
1. SyntaxHighlighter (https://github.com/syntaxhighlighter/syntaxhighlighter)
9+
10+
Copyright (c) 2004-2013, Alex Gorbatchev
11+
12+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Diff for: demo/LICENSE.txt

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Microsoft.PowerBI.JavaScript
2+
3+
Copyright (c) Microsoft Corporation
4+
5+
All rights reserved.
6+
7+
MIT License
8+
9+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Diff for: demo/NOTICE.txt

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Microsoft.PowerBI.JavaScript
2+
3+
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
4+
Do Not Translate or Localize
5+
6+
This project incorporates components from the projects listed below. The original copyright notices and the licenses under which Microsoft received such components are set forth below. Microsoft reserves all rights not expressly granted herein, whether by implication, estoppel or otherwise.
7+
8+
1. SyntaxHighlighter (https://github.com/syntaxhighlighter/syntaxhighlighter)
9+
10+
Copyright (c) 2004-2013, Alex Gorbatchev
11+
12+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Diff for: demo/code-demo/code_area.html

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
<div class="editorTitle">Code</div>
33
<div class="textAreaControls">
44
<button id="btnRunCode" class="textAreaControl">
5-
<img src="images\run.png"/> Run
5+
<img src="images\run.png" /> Run
66
</button>
77
<button id="btnCopyCode" class="textAreaControl" onclick="CopyCode();">
8-
<img src="images\copy.png"/> Copy
8+
<img src="images\copy.png" /> Copy
99
</button>
1010
</div>
11-
<textarea id="txtCode" readonly />
11+
12+
<div id="highlighter">
13+
</div>

Diff for: demo/code-demo/index.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77

88
<link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.css" />
9+
<link type="text/css" rel="stylesheet" href="syntaxhighlighter/theme.css">
910
<link rel="stylesheet" type="text/css" href="style/style.css">
1011
<link rel="stylesheet" type="text/css" href="style/layout.css">
12+
<link rel="stylesheet" type="text/css" href="style/syntaxHighlighterOverride.css">
13+
1114
</head>
1215

1316
<body>
@@ -47,7 +50,7 @@
4750
<script src="../node_modules/jquery/dist/jquery.js"></script>
4851
<script src="../node_modules/es6-promise/dist/es6-promise.js"></script>
4952
<script src="../node_modules/powerbi-client/dist/powerbi.js"></script>
50-
53+
5154
<script src="scripts/codesamples.js"></script>
5255

5356
<script src="scripts/index.js"></script>

Diff for: demo/code-demo/scripts/utils.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ function LoadLogWindow(divSelector) {
5050
}
5151

5252
function SetCode(func) {
53-
$("#txtCode").val(BodyCodeOfFunction(func));
53+
var codeHtml = '<pre id="txtCode" class="brush: js; gutter: false;">';
54+
codeHtml = codeHtml + BodyCodeOfFunction(func) + '</pre><script type="text/javascript" src="syntaxhighlighter/syntaxhighlighter.js"></script>';
55+
$("#highlighter").html(codeHtml);
5456

5557
var runFunc = mapFunc(func);
5658

Diff for: demo/code-demo/step_authorize.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<div id="authStepDiv">
3-
<div id="sampleReport" class="line">
3+
<div id="sampleReport" class="pbi-line">
44
<div class="pageTitle">
55
<h3>Sample Report</h3>
66
<h8>You can embed a sample report and interact with Power BI Embedded firsthand by clicking below.</h8>
@@ -12,22 +12,22 @@ <h3>Sample Report</h3>
1212

1313
<hr />
1414

15-
<div id="userReport" class="line">
15+
<div id="userReport" class="pbi-line">
1616
<div class="pageTitle">
1717
<h3>Embed your own report</h3>
1818
<h8>You can also embed your own report by following the instructions below.</h8>
1919
</div>
2020
<div class="settings">
2121
<div id="EmbedWithSpecificReportDiv">
22-
<div class="line">
22+
<div class="pbi-line">
2323
<h5>Prerequisites</h5>
2424
<ul>
2525
<li>A workspace in the <a href="https://azure.microsoft.com/en-us/documentation/articles/power-bi-embedded-get-started/">Power BI embedded service.</a></li>
2626
<li>Power BI report imported to your workspace.</li>
2727
</ul>
2828
</div>
2929

30-
<div class="line">
30+
<div class="pbi-line">
3131
<h5>Instructions to generate an embed App Token</h5>
3232
Once you have improted a report into Power BI workspace, you are ready to embed it.
3333

@@ -39,7 +39,7 @@ <h5>Instructions to generate an embed App Token</h5>
3939
</ul>
4040
</div>
4141

42-
<div id="authorizeParameterDiv" class="line">
42+
<div id="authorizeParameterDiv" class="pbi-line">
4343
<h5>Enter embed details</h5>
4444

4545
<table id="user-embed-details">

Diff for: demo/code-demo/style/style.css

+5-3
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ a {
134134
width: 100%;
135135
}
136136

137-
.line {
137+
.pbi-line {
138138
display: inline-block;
139139
width: 100%;
140140
}
@@ -509,10 +509,12 @@ a {
509509
width: 100%;
510510
height: 300px;
511511
border: none;
512-
padding-top: 40px;
512+
padding: 20px;
513513
position: relative;
514514
top: -30px;
515-
padding-left: 20px;
515+
background: #FFFFFF;
516+
overflow: auto;
517+
white-space: pre-wrap;
516518
}
517519

518520
#GoToEmbedStepButton {

Diff for: demo/code-demo/style/syntaxHighlighterOverride.css

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.syntaxhighlighter {
2+
overflow: hidden !important;
3+
margin: 0em !important;
4+
padding: 0em !important;
5+
top: -98px !important;
6+
}
7+
8+
.syntaxhighlighter .line {
9+
white-space: pre-wrap !important;
10+
}

0 commit comments

Comments
 (0)