Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Linefeed option #368

Merged
merged 9 commits into from
Dec 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scout-files/_sass/_projectsettings.sass
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ $calcHeader: calc(100% - 100px)
color: #95A5A6
cursor: pointer

#environment
#environment,
#linefeed
input
margin-right: -15px
label
Expand Down
4 changes: 4 additions & 0 deletions scout-files/_scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@
function convertToCSS (project, inputFileName, inputFileExt, inputSubFolder) {
var outputSubFolder = inputSubFolder || '';
var outputStyle = project.outputStyle;

var linefeed = project.linefeed;

var pathToProject = ugui.app.pathToProject;
// Get the mixins config file
var mixins = ugui.helpers.readAFile('scout-files/mixins/mixins.config');
Expand Down Expand Up @@ -132,6 +135,7 @@
'file': fullFilePath,
'outfile': sourceMap,
'outputStyle': outputStyle,
'linefeed': linefeed,
'indentedSyntax': true,
'includePaths': mixins,
'sourceComments': devMode,
Expand Down
10 changes: 10 additions & 0 deletions scout-files/_scripts/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,16 @@
}
}
});
$('#linefeed input').change(function (evt) {
var id = $('#projectID').val();
var linefeed = $(evt.currentTarget).val();
for (var i = 0; i < scout.projects.length; i++) {
if (id == scout.projects[i].projectID) {
scout.projects[i].linefeed = linefeed;
}
}
scout.helpers.saveSettings();
});
$('#inputFolder').on('blur', function () {
var newDir = $('#inputFolder').val();
newDir = newDir.split('\\').join('\/');
Expand Down
28 changes: 25 additions & 3 deletions scout-files/_scripts/project-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
$('#outputWarning').addClass('hide');
$('#environment input[data-argname="production"]').click();
$($('#outputStyle option')[5]).prop('selected', true);
$('#linefeed input[data-argname="linefeedlf"]').prop('checked', true);
$('#printConsole .alert, #printConsole .panel').addClass('hide');

var newProject = {
Expand All @@ -38,6 +39,7 @@
'outputFolder': '',
'environment': 'production',
'outputStyle': 'compressed',
'linefeed': 'lf',
'indicator': 'play'
};
scout.newProject = newProject;
Expand Down Expand Up @@ -112,7 +114,8 @@
* "outputFolder": "~/GitHub/my-project/_style",
* "projectIcon": "~/GitHub/my-project/_img/meta/logo.png",
* "environment": "production",
* "outputStyle": "compressed"
* "outputStyle": "compressed",
* "linefeed": "lf"
* }
*
* @param {object} project
Expand Down Expand Up @@ -162,6 +165,16 @@
project.environment = environment;

project.outputStyle = $('#outputStyle').val();

var lfChecked = $('#linefeed input[data-argname="linefeedlf"]').prop('checked');
var crlfChecked = $('#linefeed input[data-argname="linefeedcrlf"]').prop('checked');
var linefeed = 'lf';
if (lfChecked) {
linefeed = 'lf';
} else if (crlfChecked) {
linefeed = 'crlf';
}
project.linefeed = linefeed;
}
}
saveSettings();
Expand Down Expand Up @@ -219,7 +232,8 @@
* "outputFolder": "~/GitHub/my-project/_style",
* "projectIcon": "~/GitHub/my-project/_img/meta/logo.png",
* "environment": "production",
* "outputStyle": "compressed"
* "outputStyle": "compressed",
* "linefeed": "lf"
* }
*
*/
Expand Down Expand Up @@ -257,6 +271,13 @@
$('#environment input[data-argName="development"]').click();
}

// Linefeed
if (base.linefeed == 'lf') {
$('#linefeed input[data-argName="linefeedlf"]').prop('checked', true);
} else if (base.linefeed == 'crlf') {
$('#linefeed input[data-argName="linefeedcrlf"]').prop('checked', true);
}

$('#printConsole .alert, #printConsole .panel').addClass('hide');
$('#project-settings').removeClass('hide');
$('#printConsole .' + base.projectID).removeClass('hide');
Expand Down Expand Up @@ -285,7 +306,8 @@
// outputFolder: '',
// projectIcon: '',
// environment: '',
// outputStyle: ''
// outputStyle: '',
// linefeed: ''
// };
// scout.helpers.addProject(project);
scout.helpers.addProject = addProject;
Expand Down
2 changes: 1 addition & 1 deletion scout-files/_style/style.css

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions scout-files/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,19 @@ <h3 data-lang="ENVIRONMENT"></h3>
</select>

</div>

<div id="linefeed" class="col-xs-12 col-s-12 col-md-12 col-l-12 radio" data-langtitle="LINEFEED">
<label data-lang="LINEFEED"></label>
<div class="col-xs-12">
<input id="linefeedlf" type="radio" name="linefeed" data-argname="linefeedlf" value="lf" checked="">
<label for="linefeedlf" class="col-xs-12 col-s-6 col-md-6 col-l-6">LF (Default)</label>
</div>
<div class="col-xs-12">
<input id="linefeedcrlf" type="radio" name="linefeed" data-argname="linefeedcrlf" value="crlf">
<label for="linefeedcrlf" class="col-xs-12 col-s-6 col-md-6 col-l-6">CRLF</label>
</div>
</div>

</div>

<div class="row">
Expand Down