Skip to content

Commit

Permalink
Add Colors to code
Browse files Browse the repository at this point in the history
  • Loading branch information
t-naabus authored and ali-hamud committed Mar 7, 2017
1 parent 3279068 commit bfc17b9
Show file tree
Hide file tree
Showing 13 changed files with 4,086 additions and 15 deletions.
16 changes: 16 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Microsoft.PowerBI.JavaScript

THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
Do Not Translate or Localize

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.

1. SyntaxHighlighter (https://github.com/syntaxhighlighter/syntaxhighlighter)

Copyright (c) 2004-2013, Alex Gorbatchev

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:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

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.
13 changes: 13 additions & 0 deletions demo/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Microsoft.PowerBI.JavaScript

Copyright (c) Microsoft Corporation

All rights reserved.

MIT License

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:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

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.
16 changes: 16 additions & 0 deletions demo/NOTICE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Microsoft.PowerBI.JavaScript

THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
Do Not Translate or Localize

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.

1. SyntaxHighlighter (https://github.com/syntaxhighlighter/syntaxhighlighter)

Copyright (c) 2004-2013, Alex Gorbatchev

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:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

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.
8 changes: 5 additions & 3 deletions demo/code-demo/code_area.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
<div class="editorTitle">Code</div>
<div class="textAreaControls">
<button id="btnRunCode" class="textAreaControl">
<img src="images\run.png"/> Run
<img src="images\run.png" /> Run
</button>
<button id="btnCopyCode" class="textAreaControl" onclick="CopyCode();">
<img src="images\copy.png"/> Copy
<img src="images\copy.png" /> Copy
</button>
</div>
<textarea id="txtCode" readonly />

<div id="highlighter">
</div>
5 changes: 4 additions & 1 deletion demo/code-demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.css" />
<link type="text/css" rel="stylesheet" href="syntaxhighlighter/theme.css">
<link rel="stylesheet" type="text/css" href="style/style.css">
<link rel="stylesheet" type="text/css" href="style/layout.css">
<link rel="stylesheet" type="text/css" href="style/syntaxHighlighterOverride.css">

</head>

<body>
Expand Down Expand Up @@ -47,7 +50,7 @@
<script src="../node_modules/jquery/dist/jquery.js"></script>
<script src="../node_modules/es6-promise/dist/es6-promise.js"></script>
<script src="../node_modules/powerbi-client/dist/powerbi.js"></script>

<script src="scripts/codesamples.js"></script>

<script src="scripts/index.js"></script>
Expand Down
4 changes: 3 additions & 1 deletion demo/code-demo/scripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ function LoadLogWindow(divSelector) {
}

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

var runFunc = mapFunc(func);

Expand Down
10 changes: 5 additions & 5 deletions demo/code-demo/step_authorize.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<div id="authStepDiv">
<div id="sampleReport" class="line">
<div id="sampleReport" class="pbi-line">
<div class="pageTitle">
<h3>Sample Report</h3>
<h8>You can embed a sample report and interact with Power BI Embedded firsthand by clicking below.</h8>
Expand All @@ -12,22 +12,22 @@ <h3>Sample Report</h3>

<hr />

<div id="userReport" class="line">
<div id="userReport" class="pbi-line">
<div class="pageTitle">
<h3>Embed your own report</h3>
<h8>You can also embed your own report by following the instructions below.</h8>
</div>
<div class="settings">
<div id="EmbedWithSpecificReportDiv">
<div class="line">
<div class="pbi-line">
<h5>Prerequisites</h5>
<ul>
<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>
<li>Power BI report imported to your workspace.</li>
</ul>
</div>

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

Expand All @@ -39,7 +39,7 @@ <h5>Instructions to generate an embed App Token</h5>
</ul>
</div>

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

<table id="user-embed-details">
Expand Down
8 changes: 5 additions & 3 deletions demo/code-demo/style/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ a {
width: 100%;
}

.line {
.pbi-line {
display: inline-block;
width: 100%;
}
Expand Down Expand Up @@ -509,10 +509,12 @@ a {
width: 100%;
height: 300px;
border: none;
padding-top: 40px;
padding: 20px;
position: relative;
top: -30px;
padding-left: 20px;
background: #FFFFFF;
overflow: auto;
white-space: pre-wrap;
}

#GoToEmbedStepButton {
Expand Down
10 changes: 10 additions & 0 deletions demo/code-demo/style/syntaxHighlighterOverride.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.syntaxhighlighter {
overflow: hidden !important;
margin: 0em !important;
padding: 0em !important;
top: -98px !important;
}

.syntaxhighlighter .line {
white-space: pre-wrap !important;
}
Loading

0 comments on commit bfc17b9

Please sign in to comment.