Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Urvil Shah
/
MobEasyEditor
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Registry
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4294cdd6
authored
Apr 09, 2018
by
Urvil Shah
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
WrapUnSubScribeUrl and add option to select WrapUrl
parent
3c62d8bf
Pipeline
#7319
passed with stages
in 22 minutes 51 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
4 deletions
Mobile.Search.Web/Controllers/TemplateController.cs
Mobile.Search.Web/Views/Template/FroalaIndex.cshtml
Mobile.Search.Web/Controllers/TemplateController.cs
View file @
4294cdd6
...
...
@@ -143,7 +143,7 @@ namespace Mobile.Search.Web.Controllers
// POST: Template/Edit/5
[
HttpPost
,
ValidateInput
(
false
)]
public
ActionResult
FroalaIndex
(
string
key
,
string
value
,
string
EmailId
,
bool
isSendEmail
=
false
)
public
ActionResult
FroalaIndex
(
string
key
,
string
value
,
string
EmailId
,
bool
isSendEmail
=
false
,
bool
WrapUrl
=
false
,
bool
AdvertiserHasUnSub
=
true
)
{
try
{
...
...
@@ -156,11 +156,21 @@ namespace Mobile.Search.Web.Controllers
m
=
Regex
.
Match
(
value
,
HRefPattern
,
RegexOptions
.
IgnoreCase
|
RegexOptions
.
Compiled
,
TimeSpan
.
FromSeconds
(
1
));
while
(
m
.
Success
)
int
count
=
Regex
.
Matches
(
value
,
HRefPattern
).
Count
;
if
(!
isSendEmail
)
WrapUrl
=
true
;
while
(
m
.
Success
&&
WrapUrl
)
{
if
(!
m
.
Value
.
Contains
(
"Wrap"
))
count
=
count
-
1
;
if
(!
m
.
Value
.
Contains
(
"Wrap"
))
{
string
to_replace
=
String
.
Format
(
"{{{{WrapUrl('{0}')}}}}"
,
m
.
Groups
[
1
]);
if
(
count
==
0
&&
AdvertiserHasUnSub
)
{
to_replace
=
String
.
Format
(
"{{{{WrapAdvertiserUnsubscribeUrl('{0}')}}}}"
,
m
.
Groups
[
1
]);
}
value
=
value
.
Replace
(
m
.
Groups
[
1
].
Value
,
to_replace
);
}
m
=
m
.
NextMatch
();
...
...
Mobile.Search.Web/Views/Template/FroalaIndex.cshtml
View file @
4294cdd6
...
...
@@ -134,6 +134,18 @@
</div>
</div>
<!-- <iframe width="375" height="650" src="/search/template?templateKey=@Model.Key&keyword=audi+a4&debug=true" style="border: solid 1px black; margin: auto"></iframe>-->
<div
id=
"wrap_url_cb"
>
<div>
<h3>
Wrap Url :
</h3>
@Html.CheckBox("WrapUrl", false,new { id = "WrapUrl" })
</div>
<div>
<h3>
Advertiser has Unsubscribed Url :
</h3>
@Html.CheckBox("WrapAdvertiserUrl", false,new {id = "WrapAdvertiserUrl"})
</div>
</div>
</div>
</div>
...
...
@@ -272,12 +284,17 @@
var
EmailId
=
document
.
getElementById
(
"EmailId"
).
value
;
var
key
=
document
.
getElementById
(
"KeyValue"
).
value
;
var
WrapUrl
=
document
.
getElementById
(
"WrapUrl"
).
checked
;
var
WrapAdvertiserUrl
=
document
.
getElementById
(
"WrapAdvertiserUrl"
).
checked
;
alert
(
WrapAdvertiserUrl
);
alert
(
WrapUrl
);
$
.
ajax
({
url
:
"/Template/FroalaIndex"
,
type
:
"POST"
,
data
:
JSON
.
stringify
({
'key'
:
key
,
'value'
:
Content
,
'EmailId'
:
EmailId
,
'isSendEmail'
:
true
}),
data
:
JSON
.
stringify
({
'key'
:
key
,
'value'
:
Content
,
'EmailId'
:
EmailId
,
'isSendEmail'
:
true
,
'WrapUrl'
:
WrapUrl
,
'AdvertiserHasUnSub'
:
WrapAdvertiserUrl
}),
dataType
:
"json"
,
traditional
:
true
,
contentType
:
"application/json; charset=utf-8"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment